Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RWTH.nb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RWTHjupyter
RWTH.nb
Merge requests
!5
WIP: Add new submission class which will communicate with the RWTH JupyterHub service
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
WIP: Add new submission class which will communicate with the RWTH JupyterHub service
submission
into
master
Overview
0
Commits
4
Pipelines
0
Changes
4
Merged
Steffen Vogel
requested to merge
submission
into
master
5 years ago
Overview
0
Commits
4
Pipelines
0
Changes
4
/cc
@rohlfing
0
0
Merge request reports
Compare
master
version 3
1e28bbd6
4 years ago
version 2
51e54d06
4 years ago
version 1
acc6a841
5 years ago
master (base)
and
latest version
latest version
8705b899
4 commits,
4 years ago
version 3
1e28bbd6
3 commits,
4 years ago
version 2
51e54d06
2 commits,
4 years ago
version 1
acc6a841
1 commit,
5 years ago
4 files
+
279
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
examples/submission.ipynb
0 → 100644
+
97
−
0
View file @ 8705b899
Edit in single-file editor
Open in Web IDE
Show full file
%% Cell type:markdown id: tags:
# Example notebooks for using the submission service
%% Cell type:code id: tags:
```
python
from
rwth_nb.misc.submission
import
Submission
from
random
import
randint
from
pprint
import
pprint
sub
=
Submission
(
'
test_realm
'
)
```
%% Cell type:code id: tags:
```
python
print
(
'
\n
Create some random submissions...
'
)
for
i
in
range
(
5
):
sub
.
submit
({
'
random_integer
'
:
randint
(
1
,
100
)
})
```
%% Cell type:markdown id: tags:
## Admin actions
For performing admin actions the user must own the role manager-{profile_slug} or submission-{realm}
%% Cell type:code id: tags:
```
python
print
(
'
\n
All submissions:
'
)
pprint
(
sub
.
get_all
())
print
(
'
\n
Delete all submissions
'
)
sub
.
delete_all
()
print
(
'
\n
All submissions:
'
)
pprint
(
sub
.
get_all
())
```
%% Cell type:markdown id: tags:
## User actions
%% Cell type:code id: tags:
```
python
if
sub
.
is_submitted
():
print
(
'
\n
Evaluation already submitted
'
)
else
:
print
(
'
\n
Nothing submitted yet!
'
)
sub
.
submit
({
'
test
'
:
[
1
,
2
,
3
]})
if
sub
.
is_submitted
():
print
(
'
\n
Now it is submitted!:
'
)
pprint
(
sub
.
get
())
print
(
'
\n
My submissions:
'
)
mysubs
=
sub
.
get
()
print
(
mysubs
)
ident
=
mysubs
[
0
][
'
id
'
]
print
(
f
'
\n
My submission ID:
{
ident
}
'
)
print
(
f
'
\n
Deleting my submission with ID:
{
ident
}
'
)
sub
.
delete
(
ident
=
ident
)
print
(
'
\n
My submissions:
'
)
mysubs
=
sub
.
get
()
print
(
mysubs
)
```
%% Cell type:markdown id: tags:
## Submitting whole notebooks
The following cell submits the current notebook contents
%% Cell type:code id: tags:
```
python
sub
.
submit_notebook
()
```
%% Cell type:markdown id: tags:
The following cell fetches all submitted notebooks in the current realm by the current user and stores them in the current directory
%% Cell type:code id: tags:
```
python
sub
.
fetch_notebook
(
subdir
=
'
fetched_notebooks
'
,
prefix
=
'
a1
'
)
```
Loading