diff --git a/dataproc/api/models/__pycache__/computationhost_model.cpython-38.pyc b/dataproc/api/models/__pycache__/computationhost_model.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e38cb55907e9956adbb8d6ca021d99024a91fba3 Binary files /dev/null and b/dataproc/api/models/__pycache__/computationhost_model.cpython-38.pyc differ diff --git a/dataproc/api/models/__pycache__/computinghost_model.cpython-38.pyc b/dataproc/api/models/__pycache__/computinghost_model.cpython-38.pyc index ce0680db48c07496a73642bc80b3ce8fed7430cc..81b2e94258c45c27eb2b8434ce4a87b5e305de0d 100644 Binary files a/dataproc/api/models/__pycache__/computinghost_model.cpython-38.pyc and b/dataproc/api/models/__pycache__/computinghost_model.cpython-38.pyc differ diff --git a/dataproc/api/models/__pycache__/construct_model.cpython-38.pyc b/dataproc/api/models/__pycache__/construct_model.cpython-38.pyc index 6d424a4837c4f4c4cb5e75522be507b0fe4d2644..dcd053538578948fbf044c61acf1006b1ac873ad 100644 Binary files a/dataproc/api/models/__pycache__/construct_model.cpython-38.pyc and b/dataproc/api/models/__pycache__/construct_model.cpython-38.pyc differ diff --git a/dataproc/api/models/__pycache__/datacollection_model.cpython-38.pyc b/dataproc/api/models/__pycache__/datacollection_model.cpython-38.pyc index 74e717e3b18d8aff8e735c46424a8e2dbc8bd31d..95b0ebf45d8123190927ec8a4f7d0e842cbf19e2 100644 Binary files a/dataproc/api/models/__pycache__/datacollection_model.cpython-38.pyc and b/dataproc/api/models/__pycache__/datacollection_model.cpython-38.pyc differ diff --git a/dataproc/api/models/__pycache__/dataset_model.cpython-38.pyc b/dataproc/api/models/__pycache__/dataset_model.cpython-38.pyc index cc5d1d1339dbb7b7c27e8157456b2a3fb2fad576..ef349b8b3a34fd534c313a36eda04a45edeb974f 100644 Binary files a/dataproc/api/models/__pycache__/dataset_model.cpython-38.pyc and b/dataproc/api/models/__pycache__/dataset_model.cpython-38.pyc differ diff --git a/dataproc/api/models/__pycache__/ocf_model.cpython-38.pyc b/dataproc/api/models/__pycache__/ocf_model.cpython-38.pyc index 577af122c6e3c9bc4d17e4b659d17b859333e6a8..d5c26858515beb629c80af40e18b63dd7232323d 100644 Binary files a/dataproc/api/models/__pycache__/ocf_model.cpython-38.pyc and b/dataproc/api/models/__pycache__/ocf_model.cpython-38.pyc differ diff --git a/dataproc/api/models/__pycache__/storagehost_model.cpython-38.pyc b/dataproc/api/models/__pycache__/storagehost_model.cpython-38.pyc index 8f2aab13a446a0d9219b9e667a3f1c952e46c767..3e9355074a240b129d6b5edebbc89d4f13a2af19 100644 Binary files a/dataproc/api/models/__pycache__/storagehost_model.cpython-38.pyc and b/dataproc/api/models/__pycache__/storagehost_model.cpython-38.pyc differ diff --git a/dataproc/api/models/__pycache__/user_model.cpython-38.pyc b/dataproc/api/models/__pycache__/user_model.cpython-38.pyc index 3a48f8ccc0af0b9a1f94848340f4eb2340bbbec5..ac44aad4204f14d9d487e183b46302d7c09137b0 100644 Binary files a/dataproc/api/models/__pycache__/user_model.cpython-38.pyc and b/dataproc/api/models/__pycache__/user_model.cpython-38.pyc differ diff --git a/dataproc/api/models/computinghost_model.py b/dataproc/api/models/computinghost_model.py deleted file mode 100644 index 042ac47fb3074e99c81da250be994a64e3eb63d6..0000000000000000000000000000000000000000 --- a/dataproc/api/models/computinghost_model.py +++ /dev/null @@ -1,26 +0,0 @@ -from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo -from uuid import uuid4 - -class ComputingHost(StructuredNode): - ip=StringProperty() - uuid=StringProperty(unique_index=True, default=uuid4) - hostname=StringProperty() - friendlyname=StringProperty() - workingdirectory=StringProperty() - - @property - def serialize(self): - - """ - Serializer for node properties - """ - - return { - 'node_properties': { - 'ip': self.name, - 'uuid': self.uuid, - 'hostname': self.sh_files, - 'friendlyname': self.sh_files_number, - 'workingdirectory': self.workingdirectory, - }, - } \ No newline at end of file diff --git a/dataproc/api/models/construct_model.py b/dataproc/api/models/construct_model.py index 1251328818b0ce2c9019fc3a121d2651b726f567..9373b4e103231fa4190b34aeb062c681ad408cc7 100644 --- a/dataproc/api/models/construct_model.py +++ b/dataproc/api/models/construct_model.py @@ -1,20 +1,29 @@ +# Import libraries from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo from uuid import uuid4 +# Import models from api.models.ocf_model import OCF from api.models.storagehost_model import StorageHost -from api.models.computinghost_model import ComputingHost +from api.models.computationhost_model import ComputationHost from api.models.user_model import User class Construct(StructuredNode): + """ + Defines node properties and relationships + Provides data serializer + """ + + # Properties uuid=StringProperty(unique_index=True, default=uuid4) + userUuid=StringProperty(unique_index=True, default=uuid4) name=StringProperty() # Relationships has_ocf=RelationshipTo(OCF, 'HAS') has_storage_host=RelationshipTo(StorageHost, 'HAS') - has_computing_host=RelationshipTo(ComputingHost, 'HAS') + has_computation_host=RelationshipTo(ComputationHost, 'HAS') has_user=RelationshipTo(User, 'HAS') @property @@ -22,6 +31,7 @@ class Construct(StructuredNode): return { 'node_properties': { 'uuid': self.uuid, + 'userUuid': self.userUuid, 'name': self.name, }, } @@ -38,8 +48,8 @@ class Construct(StructuredNode): # 'nodes_related': self.serialize_relationships(self.storagehost.all()), # }, # { - # 'nodes_type': 'ComputingHost', - # 'nodes_related': self.serialize_relationships(self.computinghost.all()), + # 'nodes_type': 'ComputationHost', + # 'nodes_related': self.serialize_relationships(self.computationhost.all()), # }, # { # 'nodes_type': 'User', diff --git a/dataproc/api/models/datacollection_model.py b/dataproc/api/models/datacollection_model.py index 67c387d766c88314a641231ed131f6661612ef30..7e08cd61861b3105131a07c86be6d3eab512710a 100644 --- a/dataproc/api/models/datacollection_model.py +++ b/dataproc/api/models/datacollection_model.py @@ -1,18 +1,27 @@ +# Import libraries from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo from uuid import uuid4 +# Import models from api.models.dataset_model import Dataset class DataCollection(StructuredNode): + + """ + Defines node properties and relationships + Provides data serializer + """ + + # Properties uuid=StringProperty(unique_index=True, default=uuid4) - imagesnumber=IntegerProperty() - flux=IntegerProperty() + imagesNumber=IntegerProperty() + flux=StringProperty() resolution=StringProperty() wavelength=IntegerProperty() transmission=IntegerProperty() - exposuretime=IntegerProperty() - detectordistance=IntegerProperty() - beamlinename=StringProperty() + exposureTime=IntegerProperty() + detectorDistance=IntegerProperty() + beamlineName=StringProperty() # Relationships generates=RelationshipTo(Dataset, 'GENERATES') @@ -27,13 +36,13 @@ class DataCollection(StructuredNode): return { 'node_properties': { "uuid": self.uuid, - "imagesNumber": self.imagesnumber, + "imagesNumber": self.imagesNumber, "flux": self.flux, "resolution": self.resolution, "wavelength": self.wavelength, "transmission": self.transmission, - "exposureTime": self.exposuretime, - "detectorDistance": self.detectordistance , - "beamlineName": self.beamlinename, + "exposureTime": self.exposureTime, + "detectorDistance": self.detectorDistance , + "beamlineName": self.beamlineName, }, } \ No newline at end of file diff --git a/dataproc/api/models/dataset_model.py b/dataproc/api/models/dataset_model.py index 0509077c07641e8fcf3053c471aeab4f0464fb24..d286c0c49e26d25577c6f31f8e2263bfd2aaa008 100644 --- a/dataproc/api/models/dataset_model.py +++ b/dataproc/api/models/dataset_model.py @@ -5,22 +5,18 @@ from api.models.dpstep_model import DPStep from api.models.storagehost_model import StorageHost from api.models.construct_model import Construct - class Dataset(StructuredNode): # Properties uuid=StringProperty(unique_index=True, default=uuid4) - name=StringProperty() - # dataset_file_no=IntegerProperty() - # dataset_size=StringProperty() - filetemplatename=StringProperty() - useruuid=StringProperty() - crystaluuid=StringProperty() - currentpath=StringProperty() - generationpath=StringProperty() - blstartingdate=DateTimeProperty() - beamlinename=StringProperty() - facilityname=StringProperty() + fileTemplateName=StringProperty() + userUuid=StringProperty() + crystalUuid=StringProperty() + currentPath=StringProperty(max_length=500) + generationPath=StringProperty(max_length=500) + blStartingDate=StringProperty() + beamlineName=StringProperty() + facilityName=StringProperty() # Relationships input_of=RelationshipTo(DPStep, 'INPUT') @@ -37,17 +33,14 @@ class Dataset(StructuredNode): return { 'node_properties': { 'uuid': self.uuid, - 'name': self.name, - 'filetemplatename': self.filetemplatename, - 'useruuid': self.useruuid, - 'crystaluuid': self.crystaluuid, - 'currentpath': self.currentpath, - 'generationpath': self.generationpath, - 'blstartingdate': self.blstartingdate, - 'beamlinename': self.beamlinename, - 'facilityname': self.facilityname, - # 'dataset_file_no': self.dataset_file_no, - # 'dataset_size': self.dataset_size, + 'fileTemplateName': self.fileTemplateName, + 'userUuid': self.userUuid, + 'crystalUuid': self.crystalUuid, + 'currentPath': self.currentPath, + 'generationPath': self.generationPath, + 'blStartingDate': self.blStartingDate, + 'beamlineName': self.beamlineName, + 'facilityName': self.facilityName, }, } diff --git a/dataproc/api/models/ocf_model.py b/dataproc/api/models/ocf_model.py index 748211ce3d166954c7a3d2a3ac0939fe518f9955..f79a443a6aa491ba60d7c1b2eecc05b1f5db2014 100644 --- a/dataproc/api/models/ocf_model.py +++ b/dataproc/api/models/ocf_model.py @@ -1,17 +1,24 @@ +# Import libraries from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo from uuid import uuid4 +# Improt models from api.models.reflectionstructurefactors_model import RefelctionStructureFactors from api.models.coordinates_model import Coordinates class OCF(StructuredNode): + """ + Defines node properties and relationships + Provides data serializer + """ + # Properties uuid=StringProperty(unique_index=True, default=uuid4) name=StringProperty() - pipedreamcommand=StringProperty() - priority=StringProperty() - useruuid=StringProperty() + userUuid=StringProperty(unique_index=True, default=uuid4) + pipedreamCommand=StringProperty() + priority=IntegerProperty() # Relationships has_rsf=RelationshipTo(RefelctionStructureFactors, 'HAS') @@ -27,9 +34,9 @@ class OCF(StructuredNode): return { 'node_properties': { 'uuid': self.uuid, + 'userUuid': self.userUuid, 'name': self.name, - 'pipedreamCommand': self.pipedreamcommand, + 'pipedreamCommand': self.pipedreamCommand, 'priority': self.priority, - 'useruuid': self.useruuid, }, } \ No newline at end of file diff --git a/dataproc/api/models/storagehost_model.py b/dataproc/api/models/storagehost_model.py index db838bb4fd6649a4c437644f4395ab993c552825..70dbe6cc6e448236b1c2362866229923e7f0da99 100644 --- a/dataproc/api/models/storagehost_model.py +++ b/dataproc/api/models/storagehost_model.py @@ -4,9 +4,9 @@ from uuid import uuid4 class StorageHost(StructuredNode): ip=StringProperty() uuid=StringProperty(unique_index=True, default=uuid4) - hostname=StringProperty() - friendlyname=StringProperty() - workingdirectory=StringProperty() + hostName=StringProperty() + friendlyName=StringProperty() + workingDirectory=StringProperty() @property def serialize(self): @@ -17,10 +17,10 @@ class StorageHost(StructuredNode): return { 'node_properties': { - 'ip': self.name, + 'ip': self.ip, 'uuid': self.uuid, - 'hostname': self.sh_files, - 'friendlyname': self.sh_files_number, - 'workingdirectory': self.workingdirectory, + 'hostName': self.hostName, + 'friendlyName': self.friendlyName, + 'workingDirectory': self.workingDirectory, }, } \ No newline at end of file diff --git a/dataproc/api/models/user_model.py b/dataproc/api/models/user_model.py index ddfc973172abd085d38b0468bf3dcf4082448150..418ed3609ef855755c3190432089ddc9f82a4b3a 100644 --- a/dataproc/api/models/user_model.py +++ b/dataproc/api/models/user_model.py @@ -5,14 +5,12 @@ class User(StructuredNode): # Properties uuid=StringProperty(unique_index=True, default=uuid4) - name=StringProperty() @property def serialize(self): return { 'node_properties': { - 'uuid': self.uuid, - 'name': self.name, + 'uuid': self.uuid }, }