Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
7698c298
Commit
7698c298
authored
6 years ago
by
Swen Vermeul
Browse files
Options
Downloads
Patches
Plain Diff
bugfix for controlled vocabulary, html table for openbis object
parent
dd0d24da
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
pybis/src/python/pybis/property.py
+3
-2
3 additions, 2 deletions
pybis/src/python/pybis/property.py
pybis/src/python/pybis/pybis.py
+26
-0
26 additions, 0 deletions
pybis/src/python/pybis/pybis.py
with
29 additions
and
2 deletions
pybis/src/python/pybis/property.py
+
3
−
2
View file @
7698c298
...
@@ -59,8 +59,9 @@ class PropertyHolder():
...
@@ -59,8 +59,9 @@ class PropertyHolder():
data_type
=
property_type
[
'
dataType
'
]
data_type
=
property_type
[
'
dataType
'
]
if
data_type
==
'
CONTROLLEDVOCABULARY
'
:
if
data_type
==
'
CONTROLLEDVOCABULARY
'
:
voc
=
self
.
_openbis
.
get_terms
(
name
)
voc
=
self
.
_openbis
.
get_terms
(
name
)
if
value
not
in
voc
.
terms
:
value
=
value
.
upper
()
raise
ValueError
(
"
Value must be one of these terms:
"
+
"
,
"
.
join
(
voc
.
terms
))
if
value
not
in
voc
.
df
[
'
code
'
].
values
:
raise
ValueError
(
"
Value must be one of these terms:
"
+
"
,
"
.
join
(
voc
.
df
[
'
code
'
].
values
))
elif
data_type
in
(
'
INTEGER
'
,
'
BOOLEAN
'
,
'
VARCHAR
'
):
elif
data_type
in
(
'
INTEGER
'
,
'
BOOLEAN
'
,
'
VARCHAR
'
):
if
not
check_datatype
(
data_type
,
value
):
if
not
check_datatype
(
data_type
,
value
):
raise
ValueError
(
"
Value must be of type {}
"
.
format
(
data_type
))
raise
ValueError
(
"
Value must be of type {}
"
.
format
(
data_type
))
...
...
This diff is collapsed.
Click to expand it.
pybis/src/python/pybis/pybis.py
+
26
−
0
View file @
7698c298
...
@@ -460,6 +460,7 @@ def _subcriteria_for_code(code, object_type):
...
@@ -460,6 +460,7 @@ def _subcriteria_for_code(code, object_type):
return
get_search_type_for_entity
(
object_type
.
lower
())
return
get_search_type_for_entity
(
object_type
.
lower
())
class
Openbis
:
class
Openbis
:
"""
Interface for communicating with openBIS.
"""
Interface for communicating with openBIS.
A recent version of openBIS is required (minimum 16.05.2).
A recent version of openBIS is required (minimum 16.05.2).
...
@@ -581,6 +582,31 @@ class Openbis:
...
@@ -581,6 +582,31 @@ class Openbis:
'
update_object(sampleId, space, project, experiment, parents, children, components, properties, tagIds, attachments)
'
,
# 'update_sample(sampleId, space, project, experiment, parents, children, components, properties, tagIds, attachments)' alias
'
update_object(sampleId, space, project, experiment, parents, children, components, properties, tagIds, attachments)
'
,
# 'update_sample(sampleId, space, project, experiment, parents, children, components, properties, tagIds, attachments)' alias
]
]
def
_repr_html_
(
self
):
html
=
"""
<table border=
"
1
"
class=
"
dataframe
"
>
<thead>
<tr style=
"
text-align: right;
"
>
<th>attribute</th>
<th>value</th>
</tr>
</thead>
<tbody>
"""
attrs
=
[
'
url
'
,
'
port
'
,
'
hostname
'
,
'
verify_certificates
'
,
'
as_v3
'
,
'
as_v1
'
,
'
reg_v1
'
,
'
token
'
]
for
attr
in
attrs
:
html
+=
"
<tr> <td>{}</td> <td>{}</td> </tr>
"
.
format
(
attr
,
getattr
(
self
,
attr
,
''
)
)
html
+=
"""
</tbody>
</table>
"""
return
html
@property
@property
def
spaces
(
self
):
def
spaces
(
self
):
return
self
.
get_spaces
()
return
self
.
get_spaces
()
...
...
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