Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • openbis/openbis-public/jupyter/jupyter-openbis-gui-server
1 result
Show changes
Commits on Source (2)
{
"ServerApp": {
"jpserver_extensions": {
"jupyter-openbis-server.main": true
}
}
}
......@@ -97,8 +97,6 @@ class DataSetTypesHandler(IPythonHandler):
return
try:
dataset_types = conn.openbis.get_dataset_types()
# get all dataset types
ds_type_dicts = []
for dt in conn.openbis.get_dataset_types():
......@@ -106,23 +104,28 @@ class DataSetTypesHandler(IPythonHandler):
# get property assignments for every dataset-type
# and add them in the key «propertyAssignments»
pas = dt.get_property_assignments()
pa_dicts = pas.df[['propertyType','mandatory','ordinal','section']].to_dict(orient='records')
dt_dict['propertyAssignments'] = pa_dicts
for pa_dict in pa_dicts:
# add a few more attributes to the property assignments
pt = conn.openbis.get_property_type(pa_dict['propertyType'])
pa_dict['code'] = pt.code
pa_dict['label'] = pt.label
pa_dict['description'] = pt.description
pa_dict['dataType'] = pt.dataType
# add vocabulary, if exists, as key «terms»
if pt.dataType == 'CONTROLLEDVOCABULARY':
terms = conn.openbis.get_terms(pt.vocabulary)
terms_dict = terms.df[['code','label','description','official','ordinal']].to_dict(orient='records')
pa_dict['terms'] = terms_dict
ds_type_dicts.append(dt_dict)
pas_columns = ['propertyType', 'mandatory', 'ordinal', 'section']
if not set(pas.df).isdisjoint(pas_columns):
pa_dicts = pas.df[pas_columns].to_dict(orient='records')
dt_dict['propertyAssignments'] = pa_dicts
for pa_dict in pa_dicts:
# add a few more attributes to the property assignments
pt = conn.openbis.get_property_type(pa_dict['propertyType'])
pa_dict['code'] = pt.code
pa_dict['label'] = pt.label
pa_dict['description'] = pt.description
pa_dict['dataType'] = pt.dataType
# add vocabulary, if exists, as key «terms»
if pt.dataType == 'CONTROLLEDVOCABULARY':
terms = conn.openbis.get_terms(pt.vocabulary)
terms_columns = ['code', 'label', 'description', 'official', 'ordinal']
if not set(terms.df).isdisjoint(terms_columns):
terms_dict = terms.df[terms_columns].to_dict(orient='records')
pa_dict['terms'] = terms_dict
ds_type_dicts.append(dt_dict)
self.write({
"dataSetTypes": ds_type_dicts
......
......@@ -11,7 +11,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
setup(
name='jupyter-openbis-server',
version= '0.4.0',
version= '0.4.1rc2',
author='Swen Vermeul | ID SIS | ETH Zürich',
author_email='swen@ethz.ch',
description='Server Extension for Jupyter notebooks to connect to openBIS and download/upload datasets, inluding the notebook itself',
......