Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jupyter-openbis-gui-widget
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
openbis
openbis-public
jupyter
jupyter-openbis-gui-widget
Commits
727de66e
Commit
727de66e
authored
5 years ago
by
Swen Vermeul
Browse files
Options
Downloads
Patches
Plain Diff
fixed assignment bug
parent
34975f07
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
jupyter-openbis-extension/dataset.py
+2
-14
2 additions, 14 deletions
jupyter-openbis-extension/dataset.py
jupyter-openbis-extension/sample.py
+3
-1
3 additions, 1 deletion
jupyter-openbis-extension/sample.py
with
5 additions
and
15 deletions
jupyter-openbis-extension/dataset.py
+
2
−
14
View file @
727de66e
...
...
@@ -127,12 +127,13 @@ class DataSetUploadHandler(IPythonHandler):
return
errors
=
[]
print
(
"
--------------_HERE_-----------1
"
)
sample
=
None
experiment
=
None
if
(
data
.
get
(
'
entityIdentifier
'
)):
sample
=
None
experiment
=
None
try
:
sample
=
conn
.
openbis
.
get_sample
(
data
.
get
(
'
entityIdentifier
'
))
except
Exception
as
e
:
...
...
@@ -152,8 +153,6 @@ class DataSetUploadHandler(IPythonHandler):
{
"
entityIdentifier
"
:
"
please provide a sample or experiment identifier
"
}
)
print
(
"
--------------_HERE_-----------2
"
)
parents
=
[]
if
data
.
get
(
'
parents
'
):
parents
=
data
.
get
(
'
parents
'
)
...
...
@@ -165,8 +164,6 @@ class DataSetUploadHandler(IPythonHandler):
"
parent
"
:
"
Parent DataSet not found: {}
"
.
format
(
parent
)
})
print
(
"
--------------_HERE_-----------2a
"
)
filenames
=
[]
for
filename
in
data
.
get
(
'
files
'
):
filename
=
unquote
(
filename
)
...
...
@@ -176,7 +173,6 @@ class DataSetUploadHandler(IPythonHandler):
errors
.
append
({
"
file
"
:
"
File not found: {}
"
.
format
(
filename
)
})
print
(
"
--------------_HERE_-----------3
"
)
try
:
dataset
=
conn
.
openbis
.
new_dataset
(
...
...
@@ -191,7 +187,6 @@ class DataSetUploadHandler(IPythonHandler):
errors
.
append
({
"
create
"
:
'
Error while creating the dataset: {}
'
.
format
(
e
)
})
print
(
"
--------------_HERE_-----------4
"
)
# try to set the properties
if
data
.
get
(
'
props
'
):
...
...
@@ -211,14 +206,12 @@ class DataSetUploadHandler(IPythonHandler):
errors
.
append
({
"
prop.
"
+
prop_name
:
"
is mandatory
"
})
print
(
"
--------------_HERE_-----------5
"
)
# write errors back if already occured
if
errors
:
self
.
set_status
(
500
)
self
.
write
({
"
errors
"
:
errors
})
return
print
(
"
--------------_HERE_-----------6
"
)
try
:
dataset
.
save
()
...
...
@@ -226,7 +219,6 @@ class DataSetUploadHandler(IPythonHandler):
errors
.
append
({
"
save
"
:
'
Error while saving the dataset: {}
'
.
format
(
e
)
})
print
(
"
--------------_HERE_-----------7
"
)
# write errors back if they occured
if
errors
:
...
...
@@ -238,9 +230,7 @@ class DataSetUploadHandler(IPythonHandler):
'
status
'
:
200
,
'
statusText
'
:
'
Jupyter Notebook was successfully uploaded to: {} with permId: {}
'
.
format
(
conn
.
name
,
dataset
.
permId
)
})
print
(
'
Jupyter Notebook was successfully uploaded to: {} with permId: {}
'
.
format
(
conn
.
name
,
dataset
.
permId
))
print
(
"
--------------_HERE_-----------8
"
)
def
post
(
self
,
**
params
):
"""
Handle a request to /openbis/dataset/connection_name/permId
...
...
@@ -256,8 +246,6 @@ class DataSetUploadHandler(IPythonHandler):
return
data
=
self
.
get_json_body
()
print
(
"
Received DATA
"
)
print
(
data
)
self
.
upload_data
(
conn
=
conn
,
data
=
data
)
...
...
This diff is collapsed.
Click to expand it.
jupyter-openbis-extension/sample.py
+
3
−
1
View file @
727de66e
...
...
@@ -7,6 +7,8 @@ from urllib.parse import parse_qs
def
get_entity_for_identifier
(
conn
,
identifier
):
entity
=
None
try
:
entity
=
conn
.
openbis
.
get_sample
(
identifier
)
except
Exception
as
exc
:
...
...
@@ -17,9 +19,9 @@ def get_entity_for_identifier(conn, identifier):
entity
=
conn
.
openbis
.
get_experiment
(
identifier
)
except
Exception
as
exc
:
pass
return
entity
def
get_datasets
(
entity
,
start_with
=
None
,
count
=
None
):
datasets
=
entity
.
get_datasets
(
start_with
=
start_with
,
count
=
count
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment