From 17aa97e0514a8c8cb9f3d709e11182d79411e7ec Mon Sep 17 00:00:00 2001
From: vermeul <swen@ethz.ch>
Date: Thu, 22 Aug 2019 16:34:26 +0200
Subject: [PATCH] added freeze* and frozen* attributes, removed size from
 dataSet entity

---
 pybis/src/python/pybis/definitions.py | 20 ++++++++++----------
 pybis/src/python/pybis/experiment.py  |  6 +-----
 pybis/src/python/pybis/project.py     | 13 +++++++------
 pybis/src/python/pybis/space.py       |  5 ++---
 4 files changed, 20 insertions(+), 24 deletions(-)

diff --git a/pybis/src/python/pybis/definitions.py b/pybis/src/python/pybis/definitions.py
index 475af660875..bc8053ce5bd 100644
--- a/pybis/src/python/pybis/definitions.py
+++ b/pybis/src/python/pybis/definitions.py
@@ -10,8 +10,8 @@ def openbis_definitions(entity):
     entities = {
         "space": {
             "attrs_new": "code description".split(),
-            "attrs_up": "description".split(),
-            "attrs": "code permId description registrator registrationDate modifier modificationDate".split(),
+            "attrs_up": "description freeze freezeForProjects freezeForSamples".split(),
+            "attrs": "code permId description frozen frozenForProjects frozenForSamples registrator registrationDate modificationDate".split(),
             "multi": "".split(),
             "identifier": "spaceId",
             "create": { "@type": "as.dto.space.create.SpaceCreation"},
@@ -21,8 +21,8 @@ def openbis_definitions(entity):
         },
         "project": {
             "attrs_new": "code description space attachments".split(),
-            "attrs_up": "description space attachments".split(),
-            "attrs": "code description permId identifier space leader registrator registrationDate modifier modificationDate attachments".split(),
+            "attrs_up": "description space attachments freeze freezeForExperiments freezeForSamples".split(),
+            "attrs": "code description permId identifier space leader registrator registrationDate modifier modificationDate attachments frozen frozenForExperiments frozenForSamples".split(),
             "multi": "".split(),
             "identifier": "projectId",
             "create": { "@type": "as.dto.project.create.ProjectCreation"},
@@ -30,8 +30,8 @@ def openbis_definitions(entity):
         },
         "experiment": {
             "attrs_new": "code type project tags attachments".split(),
-            "attrs_up": "project tags attachments".split(),
-            "attrs": "code permId identifier type project tags registrator registrationDate modifier modificationDate attachments".split(),
+            "attrs_up": "project tags attachments freeze freezeForDataSets freezeForSamples".split(),
+            "attrs": "code permId identifier type project tags registrator registrationDate modifier modificationDate attachments frozen frozenForDataSets frozenForSamples".split(),
             "multi": "tags attachments".split(),
             "identifier": "experimentId",
             "create": { "@type": "as.dto.experiment.create.ExperimentCreation"},
@@ -39,8 +39,8 @@ def openbis_definitions(entity):
         },
         "sample": {
             "attrs_new": "code type project parents children container components space experiment tags attachments".split(),
-            "attrs_up": "project parents children container components space experiment tags attachments".split(),
-            "attrs": "code permId identifier type project parents children components space experiment tags registrator registrationDate modifier modificationDate attachments container".split(),
+            "attrs_up": "project parents children container components space experiment tags attachments freeze freezeForComponents freezeForChildren freezeForParents freezeForDataSets".split(),
+            "attrs": "code permId identifier type project parents children components space experiment tags registrator registrationDate modifier modificationDate attachments container frozen frozenForComponents frozenForChildren frozenForParents frozenForDataSets".split(),
             "ids2type": {
                 'parentIds': {'permId': {'@type': 'as.dto.sample.id.SamplePermId'}},
                 'childIds': {'permId': {'@type': 'as.dto.sample.id.SamplePermId'}},
@@ -185,8 +185,8 @@ def openbis_definitions(entity):
         },
         "dataSet": {
             "attrs_new": "type code kind experiment sample parents children components containers tags".split(),
-            "attrs_up": "parents children experiment sample components containers tags".split(),
-            "attrs": "code permId type kind experiment sample parents children components containers tags accessDate dataProducer dataProductionDate registrator registrationDate modifier modificationDate dataStore size measured".split(),
+            "attrs_up": "parents children experiment sample components containers tags freeze freezeForChildren freezeForParents freezeForComponents freezeForContainers".split(),
+            "attrs": "code permId type kind experiment sample parents children components containers tags accessDate dataProducer dataProductionDate registrator registrationDate modifier modificationDate dataStore measured frozen frozenForChildren frozenForParents frozenForComponents frozenForContainers".split(),
 
             "ids2type": {
                 'parentIds': {'permId': {'@type': 'as.dto.dataset.id.DataSetPermId'}},
diff --git a/pybis/src/python/pybis/experiment.py b/pybis/src/python/pybis/experiment.py
index 8a97b290441..b003643f29e 100644
--- a/pybis/src/python/pybis/experiment.py
+++ b/pybis/src/python/pybis/experiment.py
@@ -29,15 +29,11 @@ class Experiment(
         # the list of possible methods/attributes displayed
         # when invoking TAB-completition
         return [
-            'code', 'permId', 'identifier',
-            'type', 'project',
-            'props.', 
-            'project', 'tags', 'attachments', 'data',
             'get_datasets()', 'get_samples()',
             'set_tags()', 'add_tags()', 'del_tags()',
             'add_attachment()', 'get_attachments()', 'download_attachments()',
             'save()'
-        ]
+        ] + super().__dir__()
 
     @property
     def type(self):
diff --git a/pybis/src/python/pybis/project.py b/pybis/src/python/pybis/project.py
index 1d022b4dbed..8860385b793 100644
--- a/pybis/src/python/pybis/project.py
+++ b/pybis/src/python/pybis/project.py
@@ -16,12 +16,13 @@ class Project(
         """all the available methods and attributes that should be displayed
         when using the autocompletion feature (TAB) in Jupyter
         """
-        return ['code', 'permId', 'identifier', 'description', 'space', 'registrator',
-                'registrationDate', 'modifier', 'modificationDate', 'add_attachment()',
-                'get_attachments()', 'download_attachments()',
-                'get_experiments()', 'get_samples()', 'get_datasets()',
-                'save()', 'delete()'
-                ]
+
+        return [
+            'add_attachment()',
+            'get_attachments()', 'download_attachments()',
+            'get_experiments()', 'get_samples()', 'get_datasets()',
+            'save()', 'delete()'
+        ] + super().__dir__()
 
     def get_samples(self, **kwargs):
         return self.openbis.get_samples(project=self.permId, **kwargs)
diff --git a/pybis/src/python/pybis/space.py b/pybis/src/python/pybis/space.py
index c88a7748848..fb1acec29b8 100644
--- a/pybis/src/python/pybis/space.py
+++ b/pybis/src/python/pybis/space.py
@@ -16,12 +16,11 @@ class Space(
         when using the autocompletion feature (TAB) in Jupyter
         """
         return [
-            'code', 'permId', 'description', 'registrator', 'registrationDate', 'modificationDate', 
             'get_projects()', 
-            "new_project(code='', description='', attachments)", 
+            "new_project()", 
             'get_samples()', 
             'delete()'
-        ]
+        ] + super().__dir__()
 
     def __str__(self):
         return self.data.get('code', None)
-- 
GitLab