logs-py 1.14__py3-none-any.whl → 2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of logs-py might be problematic. Click here for more details.
- LOGS/Auxiliary/Constants.py +2 -2
- LOGS/Auxiliary/DateTimeConverter.py +1 -1
- LOGS/Auxiliary/Exceptions.py +1 -1
- LOGS/Auxiliary/MinimalModelGenerator.py +28 -6
- LOGS/Auxiliary/Tools.py +4 -0
- LOGS/Entities/AutoloadClientInfo.py +6 -8
- LOGS/Entities/AutoloadStatus.py +3 -3
- LOGS/Entities/{AutoloadSource.py → Bridge.py} +11 -10
- LOGS/Entities/BridgeMinimal.py +8 -0
- LOGS/Entities/BridgeRelations.py +23 -0
- LOGS/Entities/BridgeRequestParameter.py +19 -0
- LOGS/Entities/{AutoloadSourceType.py → BridgeType.py} +1 -1
- LOGS/Entities/Bridges.py +12 -0
- LOGS/Entities/{AutoloadConfiguration.py → DataSource.py} +97 -23
- LOGS/Entities/DataSourceMinimal.py +8 -0
- LOGS/Entities/DataSourceRelations.py +23 -0
- LOGS/Entities/DataSourceRequestParameter.py +44 -0
- LOGS/Entities/{AutoloadConfigurationStatus.py → DataSourceStatus.py} +1 -1
- LOGS/Entities/DataSources.py +12 -0
- LOGS/Entities/Dataset.py +83 -71
- LOGS/Entities/DatasetCreator.py +38 -18
- LOGS/Entities/DatasetMatchTypes.py +38 -6
- LOGS/Entities/DatasetRelations.py +13 -2
- LOGS/Entities/DatasetRequestParameter.py +19 -7
- LOGS/Entities/Datasets.py +1 -1
- LOGS/Entities/Document.py +2 -2
- LOGS/Entities/Experiment.py +9 -24
- LOGS/Entities/ExperimentRelations.py +23 -0
- LOGS/Entities/ExperimentRequestParameter.py +27 -2
- LOGS/Entities/Format.py +27 -61
- LOGS/Entities/FormatFormat.py +8 -6
- LOGS/Entities/FormatInstrument.py +2 -2
- LOGS/Entities/FormatMetaData.py +13 -5
- LOGS/Entities/FormatMethod.py +34 -3
- LOGS/Entities/FormatMinimal.py +11 -1
- LOGS/Entities/FormatRequestParameter.py +8 -3
- LOGS/Entities/FormatVendor.py +14 -1
- LOGS/Entities/FormatVendorRequestParameter.py +1 -0
- LOGS/Entities/ICustomSchemaRequest.py +7 -0
- LOGS/Entities/IRelatedEntityRequest.py +9 -0
- LOGS/Entities/Instrument.py +16 -2
- LOGS/Entities/InstrumentRelations.py +23 -0
- LOGS/Entities/InstrumentRequestParameter.py +34 -2
- LOGS/Entities/LabNotebookEntry.py +67 -7
- LOGS/Entities/LabNotebookEntryRelations.py +81 -0
- LOGS/Entities/LabNotebookEntryRequestParameter.py +57 -2
- LOGS/Entities/Method.py +24 -2
- LOGS/Entities/MethodRelations.py +35 -0
- LOGS/Entities/MethodRequestParameter.py +35 -1
- LOGS/Entities/Origin.py +2 -2
- LOGS/Entities/OriginRequestParameter.py +3 -3
- LOGS/Entities/Person.py +34 -3
- LOGS/Entities/PersonRelations.py +36 -3
- LOGS/Entities/PersonRequestParameter.py +50 -10
- LOGS/Entities/Project.py +15 -2
- LOGS/Entities/ProjectRelations.py +11 -0
- LOGS/Entities/ProjectRequestParameter.py +44 -3
- LOGS/Entities/Role.py +45 -16
- LOGS/Entities/RoleRelations.py +23 -0
- LOGS/Entities/RoleRequestParameter.py +28 -1
- LOGS/Entities/Sample.py +26 -32
- LOGS/Entities/SampleRelations.py +4 -2
- LOGS/Entities/SampleRequestParameter.py +5 -10
- LOGS/Entities/__init__.py +8 -7
- LOGS/Entity/Entity.py +30 -6
- LOGS/Entity/EntityRelations.py +3 -2
- LOGS/Entity/EntityRequestParameter.py +10 -5
- LOGS/Entity/EntityWithIntId.py +1 -1
- LOGS/Entity/SerializeableContent.py +10 -4
- LOGS/Interfaces/ICreationRecord.py +12 -3
- LOGS/Interfaces/IModificationRecord.py +10 -1
- LOGS/Interfaces/IProjectBased.py +30 -0
- LOGS/Interfaces/IRelatedEntity.py +34 -0
- LOGS/Interfaces/IRelationModel.py +6 -0
- LOGS/Interfaces/IRelationRequest.py +12 -0
- LOGS/Interfaces/ITypedEntity.py +28 -0
- LOGS/Interfaces/IUniqueEntity.py +2 -3
- LOGS/LOGS.py +128 -40
- LOGS/LOGSConnection.py +2 -1
- {logs_py-1.14.dist-info → logs_py-2.1.dist-info}/METADATA +1 -1
- {logs_py-1.14.dist-info → logs_py-2.1.dist-info}/RECORD +84 -70
- LOGS/Entities/AutoloadConfigurationMinimal.py +0 -8
- LOGS/Entities/AutoloadConfigurationRequestParameter.py +0 -17
- LOGS/Entities/AutoloadConfigurations.py +0 -16
- LOGS/Entities/AutoloadSourceMinimal.py +0 -8
- LOGS/Entities/AutoloadSourceRequestParameter.py +0 -13
- LOGS/Entities/AutoloadSources.py +0 -12
- /LOGS/Interfaces/{ICustomFields.py → ICustomField.py} +0 -0
- {logs_py-1.14.dist-info → logs_py-2.1.dist-info}/WHEEL +0 -0
- {logs_py-1.14.dist-info → logs_py-2.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING, Optional
|
|
2
|
+
|
|
3
|
+
from LOGS.Entity.EntityRelation import EntityRelation
|
|
4
|
+
from LOGS.Entity.EntityRelations import EntityRelations
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from LOGS.Entities.Dataset import Dataset
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ExperimentRelations(EntityRelations):
|
|
11
|
+
"""Relations of a Experiment with other entities"""
|
|
12
|
+
|
|
13
|
+
_datasets: Optional[EntityRelation["Dataset"]] = None
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def datasets(self) -> Optional[EntityRelation["Dataset"]]:
|
|
17
|
+
return self._datasets
|
|
18
|
+
|
|
19
|
+
@datasets.setter
|
|
20
|
+
def datasets(self, value):
|
|
21
|
+
from LOGS.Entities.Datasets import Datasets
|
|
22
|
+
|
|
23
|
+
self._datasets = self._entityConverter(value, Datasets)
|
|
@@ -1,11 +1,36 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
|
+
from enum import Enum
|
|
2
3
|
from typing import List, Optional
|
|
3
4
|
|
|
5
|
+
from LOGS.Entities.IRelatedEntityRequest import IRelatedEntityRequest
|
|
4
6
|
from LOGS.Entity.EntityRequestParameter import EntityRequestParameter
|
|
5
|
-
from LOGS.Interfaces.
|
|
7
|
+
from LOGS.Interfaces.ICreationRecord import ICreationRecordRequest
|
|
8
|
+
from LOGS.Interfaces.IModificationRecord import IModificationRecordRequest
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ExperimentOrder(Enum):
|
|
12
|
+
ID_ASC = "ID_ASC"
|
|
13
|
+
ID_DESC = "ID_DESC"
|
|
14
|
+
NAME_ASC = "NAME_ASC"
|
|
15
|
+
NAME_DESC = "NAME_DESC"
|
|
16
|
+
METHOD_ASC = "METHOD_ASC"
|
|
17
|
+
METHOD_DESC = "METHOD_DESC"
|
|
18
|
+
CREATED_ON_ASC = "CREATED_ON_ASC"
|
|
19
|
+
CREATED_ON_DESC = "CREATED_ON_DESC"
|
|
20
|
+
CREATED_BY_ASC = "CREATED_BY_ASC"
|
|
21
|
+
CREATED_BY_DESC = "CREATED_BY_DESC"
|
|
22
|
+
MODIFIED_ON_ASC = "MODIFIED_ON_ASC"
|
|
23
|
+
MODIFIED_ON_DESC = "MODIFIED_ON_DESC"
|
|
24
|
+
MODIFIED_BY_ASC = "MODIFIED_BY_ASC"
|
|
25
|
+
MODIFIED_BY_DESC = "MODIFIED_BY_DESC"
|
|
6
26
|
|
|
7
27
|
|
|
8
28
|
@dataclass
|
|
9
|
-
class ExperimentRequestParameter(
|
|
29
|
+
class ExperimentRequestParameter(
|
|
30
|
+
EntityRequestParameter[ExperimentOrder],
|
|
31
|
+
IRelatedEntityRequest,
|
|
32
|
+
ICreationRecordRequest,
|
|
33
|
+
IModificationRecordRequest,
|
|
34
|
+
):
|
|
10
35
|
name: Optional[str] = None
|
|
11
36
|
methodIds: Optional[List[int]] = None
|
LOGS/Entities/Format.py
CHANGED
|
@@ -9,10 +9,10 @@ from LOGS.LOGSConnection import LOGSConnection
|
|
|
9
9
|
|
|
10
10
|
@Endpoint("parsers")
|
|
11
11
|
class Format(INamedEntity, EntityWithStrId):
|
|
12
|
-
|
|
12
|
+
_formatVersion: str
|
|
13
13
|
_vendors: List[str]
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
_method: List[str]
|
|
15
|
+
_format: List[str]
|
|
16
16
|
_instruments: List[str]
|
|
17
17
|
_metaData: List[FormatMetaData]
|
|
18
18
|
|
|
@@ -24,80 +24,46 @@ class Format(INamedEntity, EntityWithStrId):
|
|
|
24
24
|
):
|
|
25
25
|
"""Represents a connected LOGS entity type"""
|
|
26
26
|
|
|
27
|
-
self.
|
|
28
|
-
self.
|
|
29
|
-
self.
|
|
30
|
-
self.
|
|
27
|
+
self._formatVersion = "0.0"
|
|
28
|
+
self._vendor = []
|
|
29
|
+
self._method = []
|
|
30
|
+
self._format = []
|
|
31
31
|
self._instruments = []
|
|
32
32
|
self._metaData = []
|
|
33
33
|
|
|
34
34
|
super().__init__(ref=ref, id=id, connection=connection)
|
|
35
35
|
|
|
36
|
-
def fromDict(self, ref, formatDict=None) -> None:
|
|
37
|
-
if isinstance(ref, dict):
|
|
38
|
-
if "metaData" in ref and isinstance(ref["metaData"], list):
|
|
39
|
-
ref["vendors"] = []
|
|
40
|
-
ref["methods"] = []
|
|
41
|
-
ref["instruments"] = []
|
|
42
|
-
ref["formats"] = []
|
|
43
|
-
for metaData in ref["metaData"]:
|
|
44
|
-
if metaData["vendor"]:
|
|
45
|
-
ref["vendors"].extend(v["name"] for v in metaData["vendor"])
|
|
46
|
-
if metaData["method"]:
|
|
47
|
-
ref["methods"].extend(v["name"] for v in metaData["method"])
|
|
48
|
-
if metaData["instrument"]:
|
|
49
|
-
ref["instruments"].extend(
|
|
50
|
-
v["name"] for v in metaData["instrument"]
|
|
51
|
-
)
|
|
52
|
-
if metaData["format"]:
|
|
53
|
-
ref["formats"].extend(v["name"] for v in metaData["format"])
|
|
54
|
-
|
|
55
|
-
if "majorVersion" in ref and "minorVersion" in ref:
|
|
56
|
-
ref["version"] = "%s.%s" % (ref["majorVersion"], ref["minorVersion"])
|
|
57
|
-
super().fromDict(ref=ref, formatDict=formatDict)
|
|
58
|
-
|
|
59
|
-
def toDict(self):
|
|
60
|
-
d = super().toDict()
|
|
61
|
-
|
|
62
|
-
if self.version:
|
|
63
|
-
d["majorVersion"], d["minorVersion"] = [
|
|
64
|
-
int(v) for v in self.version.split(".")
|
|
65
|
-
]
|
|
66
|
-
del d["version"]
|
|
67
|
-
|
|
68
|
-
return d
|
|
69
|
-
|
|
70
36
|
@property
|
|
71
|
-
def
|
|
72
|
-
return self.
|
|
37
|
+
def formatVersion(self) -> Optional[str]:
|
|
38
|
+
return self._formatVersion
|
|
73
39
|
|
|
74
|
-
@
|
|
75
|
-
def
|
|
76
|
-
self.
|
|
40
|
+
@formatVersion.setter
|
|
41
|
+
def formatVersion(self, value):
|
|
42
|
+
self._formatVersion = self.checkAndConvert(value, str, "formatVersion")
|
|
77
43
|
|
|
78
44
|
@property
|
|
79
|
-
def
|
|
80
|
-
return self.
|
|
45
|
+
def vendor(self) -> List[str]:
|
|
46
|
+
return self._vendor
|
|
81
47
|
|
|
82
|
-
@
|
|
83
|
-
def
|
|
84
|
-
self.
|
|
48
|
+
@vendor.setter
|
|
49
|
+
def vendor(self, value):
|
|
50
|
+
self._vendor = self.checkListAndConvert(value, str, "vendor")
|
|
85
51
|
|
|
86
52
|
@property
|
|
87
|
-
def
|
|
88
|
-
return self.
|
|
53
|
+
def method(self) -> List[str]:
|
|
54
|
+
return self._method
|
|
89
55
|
|
|
90
|
-
@
|
|
91
|
-
def
|
|
92
|
-
self.
|
|
56
|
+
@method.setter
|
|
57
|
+
def method(self, value):
|
|
58
|
+
self._method = self.checkListAndConvert(value, str, "method")
|
|
93
59
|
|
|
94
60
|
@property
|
|
95
|
-
def
|
|
96
|
-
return self.
|
|
61
|
+
def format(self) -> List[str]:
|
|
62
|
+
return self._format
|
|
97
63
|
|
|
98
|
-
@
|
|
99
|
-
def
|
|
100
|
-
self.
|
|
64
|
+
@format.setter
|
|
65
|
+
def format(self, value):
|
|
66
|
+
self._format = self.checkListAndConvert(value, str, "format")
|
|
101
67
|
|
|
102
68
|
@property
|
|
103
69
|
def instruments(self) -> List[str]:
|
LOGS/Entities/FormatFormat.py
CHANGED
|
@@ -8,7 +8,7 @@ from LOGS.Interfaces.INamedEntity import INamedEntity
|
|
|
8
8
|
@Endpoint("formats")
|
|
9
9
|
class FormatFormat(INamedEntity, EntityWithStrId):
|
|
10
10
|
_description: Optional[str]
|
|
11
|
-
|
|
11
|
+
_formatVersion: Optional[List[str]]
|
|
12
12
|
|
|
13
13
|
@property
|
|
14
14
|
def description(self) -> Optional[str]:
|
|
@@ -19,9 +19,11 @@ class FormatFormat(INamedEntity, EntityWithStrId):
|
|
|
19
19
|
self._description = self.checkAndConvertNullable(value, str, "description")
|
|
20
20
|
|
|
21
21
|
@property
|
|
22
|
-
def
|
|
23
|
-
return self.
|
|
22
|
+
def formatVersion(self) -> Optional[List[str]]:
|
|
23
|
+
return self._formatVersion
|
|
24
24
|
|
|
25
|
-
@
|
|
26
|
-
def
|
|
27
|
-
self.
|
|
25
|
+
@formatVersion.setter
|
|
26
|
+
def formatVersion(self, value):
|
|
27
|
+
self._formatVersion = self.checkListAndConvertNullable(
|
|
28
|
+
value, str, "formatVersion"
|
|
29
|
+
)
|
|
@@ -6,8 +6,8 @@ from LOGS.Interfaces.INamedEntity import INamedEntity
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
@Endpoint("parser_instruments")
|
|
9
|
-
class FormatInstrument(
|
|
10
|
-
_description: Optional[str]
|
|
9
|
+
class FormatInstrument(EntityWithStrId, INamedEntity):
|
|
10
|
+
_description: Optional[str] = None
|
|
11
11
|
|
|
12
12
|
@property
|
|
13
13
|
def description(self) -> Optional[str]:
|
LOGS/Entities/FormatMetaData.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
from typing import TYPE_CHECKING, List
|
|
1
|
+
from typing import TYPE_CHECKING, List, Optional
|
|
2
2
|
|
|
3
3
|
from LOGS.Auxiliary.MinimalModelGenerator import MinimalFromList
|
|
4
4
|
from LOGS.Entity.ConnectedEntity import ConnectedEntity
|
|
5
|
+
from LOGS.LOGSConnection import LOGSConnection
|
|
5
6
|
|
|
6
7
|
if TYPE_CHECKING:
|
|
7
8
|
from LOGS.Entities.FormatFormatMinimal import FormatFormatMinimal
|
|
@@ -11,10 +12,17 @@ if TYPE_CHECKING:
|
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class FormatMetaData(ConnectedEntity):
|
|
14
|
-
_vendor: List["FormatVendorMinimal"]
|
|
15
|
-
_method: List["FormatMethodMinimal"]
|
|
16
|
-
_format: List["FormatFormatMinimal"]
|
|
17
|
-
_instrument: List["FormatInstrumentMinimal"]
|
|
15
|
+
_vendor: List["FormatVendorMinimal"]
|
|
16
|
+
_method: List["FormatMethodMinimal"]
|
|
17
|
+
_format: List["FormatFormatMinimal"]
|
|
18
|
+
_instrument: List["FormatInstrumentMinimal"]
|
|
19
|
+
|
|
20
|
+
def __init__(self, ref=None, connection: Optional[LOGSConnection] = None):
|
|
21
|
+
self._vendor = []
|
|
22
|
+
self._method = []
|
|
23
|
+
self._format = []
|
|
24
|
+
self._instrument = []
|
|
25
|
+
super().__init__(ref=ref, connection=connection)
|
|
18
26
|
|
|
19
27
|
@property
|
|
20
28
|
def vendor(self) -> List["FormatVendorMinimal"]:
|
LOGS/Entities/FormatMethod.py
CHANGED
|
@@ -1,17 +1,38 @@
|
|
|
1
|
-
from typing import TYPE_CHECKING, Optional
|
|
1
|
+
from typing import TYPE_CHECKING, List, Optional
|
|
2
2
|
|
|
3
3
|
from LOGS.Auxiliary.Decorators import Endpoint
|
|
4
|
+
from LOGS.Auxiliary.MinimalModelGenerator import MinimalFromList
|
|
4
5
|
from LOGS.Entity.EntityWithStrId import EntityWithStrId
|
|
5
6
|
from LOGS.Interfaces.INamedEntity import INamedEntity
|
|
7
|
+
from LOGS.LOGSConnection import LOGSConnection
|
|
6
8
|
|
|
7
9
|
if TYPE_CHECKING:
|
|
8
|
-
|
|
10
|
+
from LOGS.Entities.FormatMethodMinimal import FormatMethodMinimal
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
@Endpoint("parser_methods")
|
|
12
|
-
class FormatMethod(
|
|
14
|
+
class FormatMethod(EntityWithStrId, INamedEntity):
|
|
13
15
|
_fullName: Optional[str]
|
|
14
16
|
_description: Optional[str]
|
|
17
|
+
_parent: Optional[List["FormatMethodMinimal"]]
|
|
18
|
+
|
|
19
|
+
def __init__(
|
|
20
|
+
self,
|
|
21
|
+
ref=None,
|
|
22
|
+
id: Optional[str] = None,
|
|
23
|
+
connection: Optional[LOGSConnection] = None,
|
|
24
|
+
):
|
|
25
|
+
self._fullName = None
|
|
26
|
+
self._description = None
|
|
27
|
+
self._parent = None
|
|
28
|
+
|
|
29
|
+
super().__init__(ref=ref, id=id, connection=connection)
|
|
30
|
+
|
|
31
|
+
def fromDict(self, ref, formatDict=None) -> None:
|
|
32
|
+
if isinstance(ref, dict) and "from" in ref:
|
|
33
|
+
ref["parent"] = ref["from"]
|
|
34
|
+
|
|
35
|
+
super().fromDict(ref=ref, formatDict=formatDict)
|
|
15
36
|
|
|
16
37
|
@property
|
|
17
38
|
def fullName(self) -> Optional[str]:
|
|
@@ -28,3 +49,13 @@ class FormatMethod(INamedEntity, EntityWithStrId):
|
|
|
28
49
|
@description.setter
|
|
29
50
|
def description(self, value):
|
|
30
51
|
self._description = self.checkAndConvertNullable(value, str, "description")
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def parent(self) -> Optional[List["FormatMethodMinimal"]]:
|
|
55
|
+
return self._parent
|
|
56
|
+
|
|
57
|
+
@parent.setter
|
|
58
|
+
def parent(self, value):
|
|
59
|
+
self._parent = MinimalFromList(
|
|
60
|
+
value, "FormatMethodMinimal", "parent", connection=self.connection
|
|
61
|
+
)
|
LOGS/Entities/FormatMinimal.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
|
|
1
3
|
from LOGS.Auxiliary.Decorators import FullModel
|
|
2
4
|
from LOGS.Entities.Format import Format
|
|
3
5
|
from LOGS.Entity.EntityMinimalWithStrId import EntityMinimalWithStrId
|
|
@@ -5,4 +7,12 @@ from LOGS.Entity.EntityMinimalWithStrId import EntityMinimalWithStrId
|
|
|
5
7
|
|
|
6
8
|
@FullModel(Format)
|
|
7
9
|
class FormatMinimal(EntityMinimalWithStrId[Format]):
|
|
8
|
-
|
|
10
|
+
_version: Optional[List[str]] = None
|
|
11
|
+
|
|
12
|
+
@property
|
|
13
|
+
def version(self) -> Optional[List[str]]:
|
|
14
|
+
return self._version
|
|
15
|
+
|
|
16
|
+
@version.setter
|
|
17
|
+
def version(self, value):
|
|
18
|
+
self._version = self.checkListAndConvertNullable(value, str, "version")
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
|
-
from typing import Optional
|
|
2
|
+
from typing import List, Optional
|
|
3
3
|
|
|
4
|
-
from LOGS.Entity.EntityRequestParameter import EntityRequestParameter
|
|
4
|
+
from LOGS.Entity.EntityRequestParameter import DefaultOrder, EntityRequestParameter
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
@dataclass
|
|
8
|
-
class FormatRequestParameter(EntityRequestParameter):
|
|
8
|
+
class FormatRequestParameter(EntityRequestParameter[DefaultOrder]):
|
|
9
9
|
name: Optional[str] = None
|
|
10
|
+
vendors: Optional[List[str]] = None
|
|
11
|
+
vendors: Optional[List[str]] = None
|
|
12
|
+
methods: Optional[List[str]] = None
|
|
13
|
+
formats: Optional[List[str]] = None
|
|
14
|
+
instruments: Optional[List[str]] = None
|
LOGS/Entities/FormatVendor.py
CHANGED
|
@@ -3,13 +3,26 @@ from typing import Optional
|
|
|
3
3
|
from LOGS.Auxiliary.Decorators import Endpoint
|
|
4
4
|
from LOGS.Entity.EntityWithStrId import EntityWithStrId
|
|
5
5
|
from LOGS.Interfaces.INamedEntity import INamedEntity
|
|
6
|
+
from LOGS.LOGSConnection import LOGSConnection
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
@Endpoint("vendors")
|
|
9
|
-
class FormatVendor(
|
|
10
|
+
class FormatVendor(EntityWithStrId, INamedEntity):
|
|
10
11
|
_description: Optional[str]
|
|
11
12
|
_icon: Optional[str]
|
|
12
13
|
|
|
14
|
+
def __init__(
|
|
15
|
+
self,
|
|
16
|
+
ref=None,
|
|
17
|
+
id: Optional[str] = None,
|
|
18
|
+
connection: Optional[LOGSConnection] = None,
|
|
19
|
+
):
|
|
20
|
+
"""Represents a connected LOGS entity type"""
|
|
21
|
+
|
|
22
|
+
self._description = None
|
|
23
|
+
self._icon = None
|
|
24
|
+
super().__init__(ref=ref, id=id, connection=connection)
|
|
25
|
+
|
|
13
26
|
@property
|
|
14
27
|
def description(self) -> Optional[str]:
|
|
15
28
|
return self._description
|
LOGS/Entities/Instrument.py
CHANGED
|
@@ -2,16 +2,30 @@ from typing import Optional
|
|
|
2
2
|
|
|
3
3
|
from LOGS.Auxiliary.Decorators import Endpoint
|
|
4
4
|
from LOGS.Auxiliary.MinimalModelGenerator import MethodMinimalFromDict
|
|
5
|
+
from LOGS.Entities.InstrumentRelations import InstrumentRelations
|
|
5
6
|
from LOGS.Entities.MethodMinimal import MethodMinimal
|
|
6
|
-
from LOGS.Entity.EntityWithIntId import
|
|
7
|
+
from LOGS.Entity.EntityWithIntId import IEntityWithIntId
|
|
8
|
+
from LOGS.Interfaces.ICreationRecord import ICreatedOn
|
|
9
|
+
from LOGS.Interfaces.IModificationRecord import IModifiedOn
|
|
7
10
|
from LOGS.Interfaces.INamedEntity import INamedEntity
|
|
8
11
|
from LOGS.Interfaces.IOwnedEntity import IOwnedEntity
|
|
12
|
+
from LOGS.Interfaces.IRelatedEntity import IRelatedEntity
|
|
9
13
|
from LOGS.Interfaces.IUniqueEntity import IUniqueEntity
|
|
10
14
|
from LOGS.LOGSConnection import LOGSConnection
|
|
11
15
|
|
|
12
16
|
|
|
13
17
|
@Endpoint("instruments")
|
|
14
|
-
class Instrument(
|
|
18
|
+
class Instrument(
|
|
19
|
+
IEntityWithIntId,
|
|
20
|
+
IRelatedEntity[InstrumentRelations],
|
|
21
|
+
INamedEntity,
|
|
22
|
+
IOwnedEntity,
|
|
23
|
+
IUniqueEntity,
|
|
24
|
+
ICreatedOn,
|
|
25
|
+
IModifiedOn,
|
|
26
|
+
):
|
|
27
|
+
_relationType = type(InstrumentRelations)
|
|
28
|
+
|
|
15
29
|
_serialnumber: Optional[str]
|
|
16
30
|
_room: Optional[str]
|
|
17
31
|
_notes: Optional[str]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING, Optional
|
|
2
|
+
|
|
3
|
+
from LOGS.Entity.EntityRelation import EntityRelation
|
|
4
|
+
from LOGS.Entity.EntityRelations import EntityRelations
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from LOGS.Entities.Dataset import Dataset
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class InstrumentRelations(EntityRelations):
|
|
11
|
+
"""Relations of a Instrument with other entities"""
|
|
12
|
+
|
|
13
|
+
_datasets: Optional[EntityRelation["Dataset"]] = None
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def datasets(self) -> Optional[EntityRelation["Dataset"]]:
|
|
17
|
+
return self._datasets
|
|
18
|
+
|
|
19
|
+
@datasets.setter
|
|
20
|
+
def datasets(self, value):
|
|
21
|
+
from LOGS.Entities.Datasets import Datasets
|
|
22
|
+
|
|
23
|
+
self._datasets = self._entityConverter(value, Datasets)
|
|
@@ -1,9 +1,41 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
|
-
from
|
|
2
|
+
from enum import Enum
|
|
3
|
+
from typing import List, Optional
|
|
3
4
|
|
|
5
|
+
from LOGS.Entities.IRelatedEntityRequest import IRelatedEntityRequest
|
|
4
6
|
from LOGS.Entity.EntityRequestParameter import EntityRequestParameter
|
|
7
|
+
from LOGS.Interfaces.ICreationRecord import ICreatedOnRequest
|
|
8
|
+
from LOGS.Interfaces.IModificationRecord import IModifiedOnRequest
|
|
9
|
+
from LOGS.Interfaces.IOwnedEntity import IOwnedEntityRequest
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class InstrumentOrder(Enum):
|
|
13
|
+
ID_ASC = "ID_ASC"
|
|
14
|
+
ID_DESC = "ID_DESC"
|
|
15
|
+
NAME_ASC = "NAME_ASC"
|
|
16
|
+
NAME_DESC = "NAME_DESC"
|
|
17
|
+
METHOD_ASC = "METHOD_ASC"
|
|
18
|
+
METHOD_DESC = "METHOD_DESC"
|
|
19
|
+
CREATED_ON_ASC = "CREATED_ON_ASC"
|
|
20
|
+
CREATED_ON_DESC = "CREATED_ON_DESC"
|
|
21
|
+
CREATED_BY_ASC = "CREATED_BY_ASC"
|
|
22
|
+
CREATED_BY_DESC = "CREATED_BY_DESC"
|
|
23
|
+
MODIFIED_ON_ASC = "MODIFIED_ON_ASC"
|
|
24
|
+
MODIFIED_ON_DESC = "MODIFIED_ON_DESC"
|
|
25
|
+
MODIFIED_BY_ASC = "MODIFIED_BY_ASC"
|
|
26
|
+
MODIFIED_BY_DESC = "MODIFIED_BY_DESC"
|
|
27
|
+
IS_OBSOLETE_ASC = "IS_OBSOLETE_ASC"
|
|
28
|
+
IS_OBSOLETE_DESC = "IS_OBSOLETE_DESC"
|
|
5
29
|
|
|
6
30
|
|
|
7
31
|
@dataclass
|
|
8
|
-
class InstrumentRequestParameter(
|
|
32
|
+
class InstrumentRequestParameter(
|
|
33
|
+
EntityRequestParameter[InstrumentOrder],
|
|
34
|
+
IRelatedEntityRequest,
|
|
35
|
+
ICreatedOnRequest,
|
|
36
|
+
IModifiedOnRequest,
|
|
37
|
+
IOwnedEntityRequest,
|
|
38
|
+
):
|
|
9
39
|
name: Optional[str] = None
|
|
40
|
+
methodIds: Optional[List[int]] = None
|
|
41
|
+
datasetIds: Optional[List[int]] = None
|
|
@@ -2,22 +2,46 @@ from datetime import datetime
|
|
|
2
2
|
from typing import Optional
|
|
3
3
|
|
|
4
4
|
from LOGS.Auxiliary.Decorators import Endpoint
|
|
5
|
+
from LOGS.Entities.LabNotebookEntryRelations import LabNotebookEntryRelations
|
|
5
6
|
from LOGS.Entity.EntityMinimalWithIntId import EntityMinimalWithIntId
|
|
6
|
-
from LOGS.Entity.EntityWithIntId import
|
|
7
|
+
from LOGS.Entity.EntityWithIntId import IEntityWithIntId
|
|
7
8
|
from LOGS.Interfaces.ICreationRecord import ICreationRecord
|
|
8
9
|
from LOGS.Interfaces.IModificationRecord import IModificationRecord
|
|
9
10
|
from LOGS.Interfaces.INamedEntity import INamedEntity
|
|
11
|
+
from LOGS.Interfaces.IRelatedEntity import IRelatedEntity
|
|
12
|
+
from LOGS.Interfaces.ISoftDeletable import ISoftDeletable
|
|
13
|
+
from LOGS.LOGSConnection import LOGSConnection
|
|
10
14
|
|
|
11
15
|
|
|
12
16
|
@Endpoint("lab_notebook_entries")
|
|
13
17
|
class LabNotebookEntry(
|
|
14
|
-
|
|
18
|
+
IEntityWithIntId,
|
|
19
|
+
IRelatedEntity[LabNotebookEntryRelations],
|
|
20
|
+
INamedEntity,
|
|
21
|
+
ICreationRecord,
|
|
22
|
+
IModificationRecord,
|
|
23
|
+
ISoftDeletable,
|
|
15
24
|
):
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
_relationType = type(LabNotebookEntryRelations)
|
|
26
|
+
|
|
27
|
+
_version: Optional[int]
|
|
28
|
+
_labNotebook: Optional[EntityMinimalWithIntId]
|
|
29
|
+
_labNotebookExperiment: Optional[EntityMinimalWithIntId]
|
|
30
|
+
_entryDate: Optional[datetime]
|
|
31
|
+
|
|
32
|
+
def __init__(
|
|
33
|
+
self,
|
|
34
|
+
ref=None,
|
|
35
|
+
id: Optional[int] = None,
|
|
36
|
+
connection: Optional[LOGSConnection] = None,
|
|
37
|
+
):
|
|
38
|
+
"""Represents a connected LOGS entity type"""
|
|
39
|
+
self._version = None
|
|
40
|
+
self._labNotebook = None
|
|
41
|
+
self._labNotebookExperiment = None
|
|
42
|
+
self._entryDate = None
|
|
43
|
+
|
|
44
|
+
super().__init__(ref=ref, id=id, connection=connection)
|
|
21
45
|
|
|
22
46
|
def fromDict(self, ref, formatDict=None) -> None:
|
|
23
47
|
if isinstance(ref, dict):
|
|
@@ -25,3 +49,39 @@ class LabNotebookEntry(
|
|
|
25
49
|
ref["name"] = ref["name"].replace(" > ", "_")
|
|
26
50
|
|
|
27
51
|
super().fromDict(ref, formatDict)
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def version(self) -> Optional[int]:
|
|
55
|
+
return self._version
|
|
56
|
+
|
|
57
|
+
@version.setter
|
|
58
|
+
def version(self, value):
|
|
59
|
+
self._version = self.checkAndConvertNullable(value, int, "version")
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def labNotebook(self) -> Optional[EntityMinimalWithIntId]:
|
|
63
|
+
return self._labNotebook
|
|
64
|
+
|
|
65
|
+
@labNotebook.setter
|
|
66
|
+
def labNotebook(self, value):
|
|
67
|
+
self._labNotebook = self.checkAndConvertNullable(
|
|
68
|
+
value, EntityMinimalWithIntId, "labNotebook"
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
@property
|
|
72
|
+
def labNotebookExperiment(self) -> Optional[EntityMinimalWithIntId]:
|
|
73
|
+
return self._labNotebookExperiment
|
|
74
|
+
|
|
75
|
+
@labNotebookExperiment.setter
|
|
76
|
+
def labNotebookExperiment(self, value):
|
|
77
|
+
self._labNotebookExperiment = self.checkAndConvertNullable(
|
|
78
|
+
value, EntityMinimalWithIntId, "labNotebookExperiment"
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
@property
|
|
82
|
+
def entryDate(self) -> Optional[datetime]:
|
|
83
|
+
return self._entryDate
|
|
84
|
+
|
|
85
|
+
@entryDate.setter
|
|
86
|
+
def entryDate(self, value):
|
|
87
|
+
self._entryDate = self.checkAndConvertNullable(value, datetime, "entryDate")
|