logs-py 2.9.6__py3-none-any.whl → 3.0.0__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/DateTimeConverter.py +11 -1
- LOGS/Auxiliary/Exceptions.py +40 -4
- LOGS/Auxiliary/LOGSErrorResponse.py +4 -1
- LOGS/Auxiliary/MinimalModelGenerator.py +88 -28
- LOGS/Auxiliary/Tools.py +11 -0
- LOGS/Converter/Conversion.py +248 -0
- LOGS/Converter/Converter.py +96 -0
- LOGS/Converter/ConverterParameter.py +88 -0
- LOGS/Converter/ExportParamters.py +89 -0
- LOGS/Converter/__init__.py +13 -0
- LOGS/Entities/Bridge.py +6 -3
- LOGS/Entities/CustomField.py +96 -91
- LOGS/Entities/CustomFieldModels.py +57 -0
- LOGS/Entities/CustomFieldRelations.py +10 -0
- LOGS/Entities/CustomFieldRequestParameter.py +43 -15
- LOGS/Entities/CustomFieldValue.py +88 -0
- LOGS/Entities/CustomFieldValueConverter.py +66 -0
- LOGS/Entities/CustomType.py +187 -0
- LOGS/Entities/CustomTypeEntityType.py +11 -0
- LOGS/Entities/CustomTypeMinimal.py +8 -0
- LOGS/Entities/CustomTypeRelations.py +59 -0
- LOGS/Entities/CustomTypeRequestParameter.py +61 -0
- LOGS/Entities/CustomTypeSection.py +39 -0
- LOGS/Entities/CustomTypes.py +12 -0
- LOGS/Entities/DataSource.py +28 -14
- LOGS/Entities/Dataset.py +274 -136
- LOGS/Entities/DatasetCreator.py +23 -72
- LOGS/Entities/DatasetInfo.py +23 -2
- LOGS/Entities/DatasetModels.py +31 -0
- LOGS/Entities/DatasetRequestParameter.py +45 -32
- LOGS/Entities/Datatrack.py +74 -30
- LOGS/Entities/DatatrackFormattedTable.py +25 -0
- LOGS/Entities/DatatrackGeneric.py +34 -0
- LOGS/Entities/DatatrackImage.py +25 -0
- LOGS/Entities/DatatrackNumericArray.py +9 -39
- LOGS/Entities/DatatrackNumericMatrix.py +86 -0
- LOGS/Entities/DocumentRequestParameter.py +2 -2
- LOGS/Entities/EntitiesRequestParameter.py +2 -2
- LOGS/Entities/Experiment.py +3 -3
- LOGS/Entities/FileExcludePattern.py +8 -0
- LOGS/Entities/FormatFormat.py +22 -1
- LOGS/Entities/FormatFormatRequestParameter.py +2 -1
- LOGS/Entities/FormatFormats.py +1 -1
- LOGS/Entities/FormattedTable/DatatypeFormattedTable.py +135 -0
- LOGS/Entities/FormattedTable/DatatypeFormattedTableCell.py +108 -0
- LOGS/Entities/FormattedTable/DatatypeFormattedTableSettings.py +11 -0
- LOGS/Entities/FormattedTable/__init__.py +9 -0
- LOGS/Entities/ILiterarTypedEntity.py +19 -0
- LOGS/Entities/Instrument.py +3 -3
- LOGS/Entities/Inventories.py +12 -0
- LOGS/Entities/Inventory.py +95 -0
- LOGS/Entities/InventoryMinimal.py +20 -0
- LOGS/Entities/InventoryRelations.py +23 -0
- LOGS/Entities/InventoryRequestParameter.py +53 -0
- LOGS/Entities/LabNotebook.py +37 -0
- LOGS/Entities/LabNotebookEntry.py +47 -24
- LOGS/Entities/LabNotebookEntryContent/BasicAttribute.py +15 -0
- LOGS/Entities/LabNotebookEntryContent/EntityAttribute.py +85 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentBlockquote.py +13 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentBulletList.py +17 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentCallout.py +40 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentContentPlaceholderNode.py +31 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentConverter.py +207 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentDocument.py +8 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentEntity.py +13 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentEntityMention.py +31 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentHeading.py +33 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentHorizontalRule.py +12 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentItem.py +37 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentListItem.py +49 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentOrderedList.py +31 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentParagraph.py +13 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentTable.py +17 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentTableCell.py +40 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentTableRow.py +8 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentTaskList.py +17 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentTaskListItem.py +31 -0
- LOGS/Entities/LabNotebookEntryContent/EntryContentText.py +33 -0
- LOGS/Entities/LabNotebookEntryContent/IEntryContentWithAttribute.py +23 -0
- LOGS/Entities/LabNotebookEntryContent/IEntryContentWithContent.py +38 -0
- LOGS/Entities/LabNotebookEntryContent/IEntryContentWithTextAttribute.py +16 -0
- LOGS/Entities/LabNotebookEntryContent/TextAttribute.py +46 -0
- LOGS/Entities/LabNotebookEntryContent/TextMarkAtributes.py +64 -0
- LOGS/Entities/LabNotebookEntryContent/TextMarkConverter.py +45 -0
- LOGS/Entities/LabNotebookEntryContent/TextMarks.py +71 -0
- LOGS/Entities/LabNotebookEntryContent/__init__.py +34 -0
- LOGS/Entities/LabNotebookEntryRequestParameter.py +2 -0
- LOGS/Entities/LabNotebookExperiment.py +52 -0
- LOGS/Entities/LabNotebookExperimentMinimal.py +8 -0
- LOGS/Entities/LabNotebookExperimentRequestParameter.py +49 -0
- LOGS/Entities/LabNotebookExperiments.py +16 -0
- LOGS/Entities/LabNotebookMinimal.py +19 -0
- LOGS/Entities/LabNotebookModels.py +14 -0
- LOGS/Entities/LabNotebookRequestParameter.py +43 -0
- LOGS/Entities/LabNotebooks.py +12 -0
- LOGS/Entities/Method.py +3 -3
- LOGS/Entities/ParserLog.py +4 -0
- LOGS/Entities/Person.py +2 -2
- LOGS/Entities/Project.py +7 -7
- LOGS/Entities/{ProjectUserPermission.py → ProjectPersonPermission.py} +14 -4
- LOGS/Entities/Role.py +3 -3
- LOGS/Entities/RunState.py +1 -0
- LOGS/Entities/Sample.py +36 -57
- LOGS/Entities/SampleRequestParameter.py +30 -15
- LOGS/Entities/Track.py +8 -4
- LOGS/Entities/TrackData.py +11 -0
- LOGS/Entities/TrackImage.py +21 -0
- LOGS/Entities/TrackImageData.py +20 -0
- LOGS/Entities/TrackMatrix.py +28 -0
- LOGS/Entities/TrackMatrixData.py +22 -0
- LOGS/Entities/TrackTable.py +21 -0
- LOGS/Entities/TrackTableData.py +22 -0
- LOGS/Entities/TrackXY.py +5 -1
- LOGS/Entities/TrackXYComplex.py +1 -1
- LOGS/Entities/__init__.py +26 -7
- LOGS/Entity/ConnectedEntity.py +39 -1
- LOGS/Entity/Entity.py +9 -14
- LOGS/Entity/SerializeableContent.py +62 -5
- LOGS/Interfaces/IHierarchyType.py +63 -0
- LOGS/Interfaces/IPermissionedEntity.py +29 -5
- LOGS/Interfaces/IProjectBased.py +1 -1
- LOGS/Interfaces/ITypedEntity.py +69 -12
- LOGS/Interfaces/IVersionedEntity.py +39 -0
- LOGS/LOGS.py +137 -46
- LOGS/LOGSConnection.py +52 -24
- LOGS/LOGSOptions.py +8 -0
- LOGS/Parameters/Color.py +92 -0
- LOGS/Parameters/ParameterBase.py +55 -0
- LOGS/Parameters/ParameterConverter.py +24 -0
- LOGS/Parameters/ParameterElement.py +99 -0
- LOGS/Parameters/ParameterList.py +52 -0
- LOGS/Parameters/ParameterTable.py +64 -0
- LOGS/Parameters/__init__.py +13 -0
- LOGS/__init__.py +1 -0
- {logs_py-2.9.6.dist-info → logs_py-3.0.0.dist-info}/METADATA +2 -1
- logs_py-3.0.0.dist-info/RECORD +263 -0
- LOGS/Entities/CustomFieldEnums.py +0 -25
- LOGS/Entities/DatasetType.py +0 -7
- LOGS/Entities/DatasetTypeMinimal.py +0 -8
- LOGS/Entities/SampleType.py +0 -34
- LOGS/Entities/SampleTypeMinimal.py +0 -8
- LOGS/Entities/SampleTypeRequestParameter.py +0 -8
- LOGS/Entities/SampleTypes.py +0 -12
- logs_py-2.9.6.dist-info/RECORD +0 -183
- {logs_py-2.9.6.dist-info → logs_py-3.0.0.dist-info}/WHEEL +0 -0
- {logs_py-2.9.6.dist-info → logs_py-3.0.0.dist-info}/top_level.txt +0 -0
LOGS/Entities/FormatFormat.py
CHANGED
|
@@ -5,10 +5,13 @@ from LOGS.Entity.EntityWithStrId import EntityWithStrId
|
|
|
5
5
|
from LOGS.Interfaces.INamedEntity import INamedEntity
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
@Endpoint("
|
|
8
|
+
@Endpoint("parser_formats")
|
|
9
9
|
class FormatFormat(INamedEntity, EntityWithStrId):
|
|
10
|
+
|
|
10
11
|
_description: Optional[str]
|
|
11
12
|
_formatVersion: Optional[List[str]]
|
|
13
|
+
_isCustom: bool
|
|
14
|
+
_hasVisualization: bool
|
|
12
15
|
|
|
13
16
|
@property
|
|
14
17
|
def description(self) -> Optional[str]:
|
|
@@ -27,3 +30,21 @@ class FormatFormat(INamedEntity, EntityWithStrId):
|
|
|
27
30
|
self._formatVersion = self.checkListAndConvertNullable(
|
|
28
31
|
value, str, "formatVersion"
|
|
29
32
|
)
|
|
33
|
+
|
|
34
|
+
@property
|
|
35
|
+
def isCustom(self) -> Optional[bool]:
|
|
36
|
+
return self._isCustom
|
|
37
|
+
|
|
38
|
+
@isCustom.setter
|
|
39
|
+
def isCustom(self, value):
|
|
40
|
+
self._isCustom = self.checkAndConvertNullable(value, bool, "isCustom")
|
|
41
|
+
|
|
42
|
+
@property
|
|
43
|
+
def hasVisualization(self) -> Optional[bool]:
|
|
44
|
+
return self._hasVisualization
|
|
45
|
+
|
|
46
|
+
@hasVisualization.setter
|
|
47
|
+
def hasVisualization(self, value):
|
|
48
|
+
self._hasVisualization = self.checkAndConvertNullable(
|
|
49
|
+
value, bool, "hasVisualization"
|
|
50
|
+
)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
|
|
3
3
|
from LOGS.Entity.EntityRequestParameter import EntityRequestParameter
|
|
4
|
+
from LOGS.Interfaces.IPermissionedEntity import IPermissionedEntityRequest
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
@dataclass
|
|
7
|
-
class FormatFormatRequestParameter(EntityRequestParameter):
|
|
8
|
+
class FormatFormatRequestParameter(EntityRequestParameter, IPermissionedEntityRequest):
|
|
8
9
|
pass
|
LOGS/Entities/FormatFormats.py
CHANGED
|
@@ -4,7 +4,7 @@ from LOGS.Entities.FormatFormatRequestParameter import FormatFormatRequestParame
|
|
|
4
4
|
from LOGS.Entity.EntityIterator import EntityIterator
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
@Endpoint("
|
|
7
|
+
@Endpoint("parser_formats")
|
|
8
8
|
class FormatFormats(EntityIterator[FormatFormat, FormatFormatRequestParameter]):
|
|
9
9
|
"""LOGS connected class FormatFormat iterator"""
|
|
10
10
|
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from typing import Dict, List, Literal, Optional, Union
|
|
3
|
+
|
|
4
|
+
from LOGS.Entities.FormattedTable.DatatypeFormattedTableCell import (
|
|
5
|
+
DatatypeFormattedTableCell,
|
|
6
|
+
)
|
|
7
|
+
from LOGS.Entity.SerializeableContent import SerializeableContent
|
|
8
|
+
|
|
9
|
+
_VTypeType = Literal["int", "float", "str", "bool"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class DatatypeFormattedTable(SerializeableContent):
|
|
13
|
+
_type: str = "formatted_table"
|
|
14
|
+
_name: Optional[str] = None
|
|
15
|
+
_id = ""
|
|
16
|
+
|
|
17
|
+
_cells: List[DatatypeFormattedTableCell] = []
|
|
18
|
+
|
|
19
|
+
_rowRange: List[int] = [sys.maxsize, -1]
|
|
20
|
+
_columnRange: List[int] = [sys.maxsize, -1]
|
|
21
|
+
|
|
22
|
+
_cellIds: Dict[str, int] = {}
|
|
23
|
+
|
|
24
|
+
_fixedRow: Optional[int] = None
|
|
25
|
+
_fixedColumn: Optional[int] = None
|
|
26
|
+
|
|
27
|
+
def appendCell(
|
|
28
|
+
self,
|
|
29
|
+
cell: Union[_VTypeType, DatatypeFormattedTableCell],
|
|
30
|
+
row: int = -1,
|
|
31
|
+
column: int = -1,
|
|
32
|
+
) -> DatatypeFormattedTableCell:
|
|
33
|
+
c = self.checkAndConvert(
|
|
34
|
+
cell, fieldName="cell", fieldType=DatatypeFormattedTableCell
|
|
35
|
+
)
|
|
36
|
+
if row >= 0:
|
|
37
|
+
c.row = row
|
|
38
|
+
if column >= 0:
|
|
39
|
+
c.column = column
|
|
40
|
+
|
|
41
|
+
id = c.id
|
|
42
|
+
index = self.getCell(id)
|
|
43
|
+
if index >= 0:
|
|
44
|
+
self.cells[index] = c
|
|
45
|
+
else:
|
|
46
|
+
self._cellIds[id] = len(self.cells)
|
|
47
|
+
self.cells.append(c)
|
|
48
|
+
|
|
49
|
+
# self.reorganizeCells()
|
|
50
|
+
|
|
51
|
+
return c
|
|
52
|
+
|
|
53
|
+
def getCell(self, id: str) -> int:
|
|
54
|
+
if id in self._cellIds:
|
|
55
|
+
return self._cellIds[id]
|
|
56
|
+
return -1
|
|
57
|
+
|
|
58
|
+
# def addCellId(self, cell: DatatypeFormattedTableCell):
|
|
59
|
+
# self.cells.sort(key=lambda c: (c.row, c.column))
|
|
60
|
+
# self._cellIds = {c.id: i for i, c in enumerate(self.cells)}
|
|
61
|
+
# self._cellIds[cell.id] = cell
|
|
62
|
+
|
|
63
|
+
def reorganizeCells(self):
|
|
64
|
+
self.cells.sort(key=lambda c: c.column)
|
|
65
|
+
self._columnRange = [self.cells[0].column, self.cells[-1].column]
|
|
66
|
+
self.cells.sort(key=lambda c: (c.row, c.column))
|
|
67
|
+
self._rowRange = [self.cells[0].row, self.cells[-1].row]
|
|
68
|
+
self._cellIds = {c.id: i for i, c in enumerate(self.cells)}
|
|
69
|
+
|
|
70
|
+
def toDict(self, validate=False):
|
|
71
|
+
self.reorganizeCells()
|
|
72
|
+
return super().toDict()
|
|
73
|
+
|
|
74
|
+
@property
|
|
75
|
+
def type(self) -> str:
|
|
76
|
+
return self._type
|
|
77
|
+
|
|
78
|
+
@type.setter
|
|
79
|
+
def type(self, value):
|
|
80
|
+
self._type = value
|
|
81
|
+
|
|
82
|
+
@property
|
|
83
|
+
def id(self) -> str:
|
|
84
|
+
return self._id
|
|
85
|
+
|
|
86
|
+
@id.setter
|
|
87
|
+
def id(self, value):
|
|
88
|
+
self._id = value
|
|
89
|
+
|
|
90
|
+
@property
|
|
91
|
+
def name(self) -> Optional[str]:
|
|
92
|
+
return self._name
|
|
93
|
+
|
|
94
|
+
@name.setter
|
|
95
|
+
def name(self, value):
|
|
96
|
+
self._name = value
|
|
97
|
+
|
|
98
|
+
@property
|
|
99
|
+
def cells(self) -> List[DatatypeFormattedTableCell]:
|
|
100
|
+
return self._cells
|
|
101
|
+
|
|
102
|
+
@cells.setter
|
|
103
|
+
def cells(self, value):
|
|
104
|
+
self._cells = self.checkListAndConvert(
|
|
105
|
+
value, fieldName="cells", fieldType=DatatypeFormattedTableCell
|
|
106
|
+
)
|
|
107
|
+
self.reorganizeCells()
|
|
108
|
+
|
|
109
|
+
@property
|
|
110
|
+
def rowRange(self) -> List[int]:
|
|
111
|
+
return self._rowRange
|
|
112
|
+
|
|
113
|
+
@property
|
|
114
|
+
def columnRange(self) -> List[int]:
|
|
115
|
+
return self._columnRange
|
|
116
|
+
|
|
117
|
+
@property
|
|
118
|
+
def fixedRow(self) -> Optional[int]:
|
|
119
|
+
return self._fixedRow
|
|
120
|
+
|
|
121
|
+
@fixedRow.setter
|
|
122
|
+
def fixedRow(self, value):
|
|
123
|
+
self._fixedRow = self.checkAndConvert(
|
|
124
|
+
value, fieldName="fixedRow", fieldType=int, allowNone=True
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
@property
|
|
128
|
+
def fixedColumn(self) -> Optional[int]:
|
|
129
|
+
return self._fixedColumn
|
|
130
|
+
|
|
131
|
+
@fixedColumn.setter
|
|
132
|
+
def fixedColumn(self, value):
|
|
133
|
+
self._fixedColumn = self.checkAndConvert(
|
|
134
|
+
value, fieldName="fixedColumn", fieldType=int, allowNone=True
|
|
135
|
+
)
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
from typing import Literal, Optional, Union
|
|
2
|
+
|
|
3
|
+
from LOGS.Entities.FormattedTable.DatatypeFormattedTableSettings import (
|
|
4
|
+
DatatypeFormattedTableSettings,
|
|
5
|
+
)
|
|
6
|
+
from LOGS.Entity.SerializeableContent import SerializeableContent
|
|
7
|
+
|
|
8
|
+
_VTypeType = Literal["int", "float", "str", "bool"]
|
|
9
|
+
_ValueType = Union[str, int, float, bool, None]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class DatatypeFormattedTableCell(SerializeableContent):
|
|
13
|
+
__vtype = {"int": int, "float": float, "str": str, "bool": bool}
|
|
14
|
+
|
|
15
|
+
_id: str = ""
|
|
16
|
+
_type: str = "formatted_table_cell"
|
|
17
|
+
_value: Optional[_ValueType] = None
|
|
18
|
+
_vtype: _VTypeType = "str"
|
|
19
|
+
_row: int = 0
|
|
20
|
+
_column: int = 0
|
|
21
|
+
_settings: Optional[DatatypeFormattedTableSettings] = None
|
|
22
|
+
|
|
23
|
+
@property
|
|
24
|
+
def type(self) -> str:
|
|
25
|
+
return self._type
|
|
26
|
+
|
|
27
|
+
@type.setter
|
|
28
|
+
def type(self, value):
|
|
29
|
+
self._type = value
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def name(self) -> str:
|
|
33
|
+
return self._name
|
|
34
|
+
|
|
35
|
+
@name.setter
|
|
36
|
+
def name(self, value):
|
|
37
|
+
self._name = value
|
|
38
|
+
|
|
39
|
+
@property
|
|
40
|
+
def value(self) -> _ValueType:
|
|
41
|
+
return self._value
|
|
42
|
+
|
|
43
|
+
@value.setter
|
|
44
|
+
def value(self, value):
|
|
45
|
+
vtype = self.vtype if self.vtype else type(value).__name__
|
|
46
|
+
|
|
47
|
+
converter = self.__vtype.get(vtype, None)
|
|
48
|
+
if converter:
|
|
49
|
+
try:
|
|
50
|
+
self._value = converter(value)
|
|
51
|
+
self._vtype = vtype
|
|
52
|
+
except:
|
|
53
|
+
raise Exception(
|
|
54
|
+
"ERROR: could not convert "
|
|
55
|
+
+ "' value '"
|
|
56
|
+
+ value
|
|
57
|
+
+ "' to type '"
|
|
58
|
+
+ value
|
|
59
|
+
+ "'"
|
|
60
|
+
)
|
|
61
|
+
else:
|
|
62
|
+
raise Exception(
|
|
63
|
+
"Unknown vtype %a. (Expected one of '%s')"
|
|
64
|
+
% (vtype, ", ".join(self.__vtype.keys()))
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def vtype(self) -> _VTypeType:
|
|
69
|
+
return self._vtype
|
|
70
|
+
|
|
71
|
+
@vtype.setter
|
|
72
|
+
def vtype(self, value):
|
|
73
|
+
if value not in self.__vtype:
|
|
74
|
+
raise Exception(
|
|
75
|
+
"Unknown vtype %a. (Expected one of '%s')"
|
|
76
|
+
% (value, ", ".join(self.__vtype.keys()))
|
|
77
|
+
)
|
|
78
|
+
self._vtype = value
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def row(self) -> int:
|
|
82
|
+
return self._row
|
|
83
|
+
|
|
84
|
+
@row.setter
|
|
85
|
+
def row(self, value):
|
|
86
|
+
self._row = value
|
|
87
|
+
|
|
88
|
+
@property
|
|
89
|
+
def column(self) -> int:
|
|
90
|
+
return self._column
|
|
91
|
+
|
|
92
|
+
@column.setter
|
|
93
|
+
def column(self, value):
|
|
94
|
+
self._column = value
|
|
95
|
+
|
|
96
|
+
@property
|
|
97
|
+
def id(self) -> str:
|
|
98
|
+
return f"{self.row}x{self.column}"
|
|
99
|
+
|
|
100
|
+
@property
|
|
101
|
+
def settings(self) -> Optional[DatatypeFormattedTableSettings]:
|
|
102
|
+
return self._settings
|
|
103
|
+
|
|
104
|
+
@settings.setter
|
|
105
|
+
def settings(self, value):
|
|
106
|
+
self._settings = self.checkAndConvert(
|
|
107
|
+
value, fieldName="settings", fieldType=DatatypeFormattedTableSettings
|
|
108
|
+
)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from typing import Dict, List, Optional
|
|
2
|
+
|
|
3
|
+
from LOGS.Entity.SerializeableContent import SerializeableClass
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class DatatypeFormattedTableSettings(SerializeableClass):
|
|
7
|
+
_type: str = "formatted_table"
|
|
8
|
+
_name: Optional[str] = None
|
|
9
|
+
_id: str = ""
|
|
10
|
+
_cells: List[str] = []
|
|
11
|
+
_cellIds: Dict[str, str] = {}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from typing import Any, Optional, cast
|
|
2
|
+
|
|
3
|
+
from LOGS.Auxiliary.Exceptions import IllegalFieldValueException
|
|
4
|
+
from LOGS.Interfaces.IEntityInterface import IEntityInterface
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ILiterarTypedEntity(IEntityInterface):
|
|
8
|
+
_type: str = cast(Any, None)
|
|
9
|
+
|
|
10
|
+
@property
|
|
11
|
+
def type(self) -> Optional[str]:
|
|
12
|
+
return self._type
|
|
13
|
+
|
|
14
|
+
@type.setter
|
|
15
|
+
def type(self, value):
|
|
16
|
+
if value != self._type:
|
|
17
|
+
raise IllegalFieldValueException(
|
|
18
|
+
self, "type", value, f"Only value '{self._type}' allowed."
|
|
19
|
+
)
|
LOGS/Entities/Instrument.py
CHANGED
|
@@ -9,7 +9,7 @@ from LOGS.Interfaces.ICreationRecord import ICreatedOn
|
|
|
9
9
|
from LOGS.Interfaces.IModificationRecord import IModifiedOn
|
|
10
10
|
from LOGS.Interfaces.INamedEntity import INamedEntity
|
|
11
11
|
from LOGS.Interfaces.IOwnedEntity import IOwnedEntity
|
|
12
|
-
from LOGS.Interfaces.IPermissionedEntity import
|
|
12
|
+
from LOGS.Interfaces.IPermissionedEntity import GenericPermissionEntity
|
|
13
13
|
from LOGS.Interfaces.IRelatedEntity import IRelatedEntity
|
|
14
14
|
from LOGS.Interfaces.IUniqueEntity import IUniqueEntity
|
|
15
15
|
from LOGS.LOGSConnection import LOGSConnection
|
|
@@ -24,9 +24,9 @@ class Instrument(
|
|
|
24
24
|
IUniqueEntity,
|
|
25
25
|
ICreatedOn,
|
|
26
26
|
IModifiedOn,
|
|
27
|
-
|
|
27
|
+
GenericPermissionEntity,
|
|
28
28
|
):
|
|
29
|
-
_relationType =
|
|
29
|
+
_relationType = InstrumentRelations
|
|
30
30
|
|
|
31
31
|
_serialnumber: Optional[str]
|
|
32
32
|
_room: Optional[str]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from LOGS.Auxiliary.Decorators import Endpoint
|
|
2
|
+
from LOGS.Entities.Inventory import Inventory
|
|
3
|
+
from LOGS.Entities.InventoryRequestParameter import InventoryRequestParameter
|
|
4
|
+
from LOGS.Entity.EntityIterator import EntityIterator
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@Endpoint("inventories")
|
|
8
|
+
class Inventories(EntityIterator[Inventory, InventoryRequestParameter]):
|
|
9
|
+
"""LOGS connected Inventories iterator"""
|
|
10
|
+
|
|
11
|
+
_generatorType = Inventory
|
|
12
|
+
_parameterType = InventoryRequestParameter
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING, List, Optional
|
|
2
|
+
|
|
3
|
+
from LOGS.Auxiliary.Decorators import Endpoint
|
|
4
|
+
from LOGS.Auxiliary.MinimalModelGenerator import MinimalFromList, MinimalFromSingle
|
|
5
|
+
from LOGS.Entities.InventoryRelations import InventoryRelations
|
|
6
|
+
from LOGS.Entity.EntityWithIntId import IEntityWithIntId
|
|
7
|
+
from LOGS.Interfaces.ICreationRecord import ICreationRecord
|
|
8
|
+
from LOGS.Interfaces.IHierarchyType import IHierarchyType
|
|
9
|
+
from LOGS.Interfaces.IModificationRecord import IModificationRecord
|
|
10
|
+
from LOGS.Interfaces.INamedEntity import INamedEntity
|
|
11
|
+
from LOGS.Interfaces.IPermissionedEntity import GenericPermissionEntity
|
|
12
|
+
from LOGS.Interfaces.IProjectBased import IProjectBased
|
|
13
|
+
from LOGS.Interfaces.IRelatedEntity import IRelatedEntity
|
|
14
|
+
from LOGS.Interfaces.ISoftDeletable import ISoftDeletable
|
|
15
|
+
from LOGS.Interfaces.ITypedEntity import ITypedEntity
|
|
16
|
+
from LOGS.Interfaces.IUniqueEntity import IUniqueEntity
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from LOGS.Entities.InventoryMinimal import InventoryMinimal
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@Endpoint("inventories")
|
|
23
|
+
class Inventory(
|
|
24
|
+
IEntityWithIntId,
|
|
25
|
+
INamedEntity,
|
|
26
|
+
IUniqueEntity,
|
|
27
|
+
ICreationRecord,
|
|
28
|
+
IModificationRecord,
|
|
29
|
+
ISoftDeletable,
|
|
30
|
+
IRelatedEntity[InventoryRelations],
|
|
31
|
+
ITypedEntity,
|
|
32
|
+
IProjectBased,
|
|
33
|
+
IHierarchyType,
|
|
34
|
+
GenericPermissionEntity,
|
|
35
|
+
):
|
|
36
|
+
_relationType = InventoryRelations
|
|
37
|
+
|
|
38
|
+
_rootCustomType: Optional["InventoryMinimal"] = None
|
|
39
|
+
_isRootItem: Optional[bool] = None
|
|
40
|
+
_isHierarchyItem: Optional[bool] = None
|
|
41
|
+
_isDeleted: Optional[bool] = None
|
|
42
|
+
_ancestors: Optional[List["InventoryMinimal"]] = None
|
|
43
|
+
_parent: Optional["InventoryMinimal"] = None
|
|
44
|
+
|
|
45
|
+
@property
|
|
46
|
+
def rootCustomType(self) -> Optional["InventoryMinimal"]:
|
|
47
|
+
return self._rootCustomType
|
|
48
|
+
|
|
49
|
+
@rootCustomType.setter
|
|
50
|
+
def rootCustomType(self, value):
|
|
51
|
+
self._rootCustomType = MinimalFromSingle(
|
|
52
|
+
value, "InventoryMinimal", "rootCustomType"
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def isRootItem(self) -> Optional[bool]:
|
|
57
|
+
return self._isRootItem
|
|
58
|
+
|
|
59
|
+
@isRootItem.setter
|
|
60
|
+
def isRootItem(self, value):
|
|
61
|
+
self._isRootItem = self.checkAndConvertNullable(value, bool, "isRootItem")
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def isHierarchyItem(self) -> Optional[bool]:
|
|
65
|
+
return self._isHierarchyItem
|
|
66
|
+
|
|
67
|
+
@isHierarchyItem.setter
|
|
68
|
+
def isHierarchyItem(self, value):
|
|
69
|
+
self._isHierarchyItem = self.checkAndConvertNullable(
|
|
70
|
+
value, bool, "isHierarchyItem"
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
@property
|
|
74
|
+
def isDeleted(self) -> Optional[bool]:
|
|
75
|
+
return self._isDeleted
|
|
76
|
+
|
|
77
|
+
@isDeleted.setter
|
|
78
|
+
def isDeleted(self, value):
|
|
79
|
+
self._isDeleted = self.checkAndConvertNullable(value, bool, "isDeleted")
|
|
80
|
+
|
|
81
|
+
@property
|
|
82
|
+
def ancestors(self) -> Optional[List["InventoryMinimal"]]:
|
|
83
|
+
return self._ancestors
|
|
84
|
+
|
|
85
|
+
@ancestors.setter
|
|
86
|
+
def ancestors(self, value):
|
|
87
|
+
self._ancestors = MinimalFromList(value, "InventoryMinimal", "ancestors")
|
|
88
|
+
|
|
89
|
+
@property
|
|
90
|
+
def parent(self) -> Optional["InventoryMinimal"]:
|
|
91
|
+
return self._parent
|
|
92
|
+
|
|
93
|
+
@parent.setter
|
|
94
|
+
def parent(self, value):
|
|
95
|
+
self._parent = MinimalFromSingle(value, "InventoryMinimal", "parent")
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from LOGS.Auxiliary.Decorators import FullModel
|
|
4
|
+
from LOGS.Entities.Inventory import Inventory
|
|
5
|
+
from LOGS.Entity.EntityMinimalWithIntId import EntityMinimalWithIntId
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@FullModel(Inventory)
|
|
9
|
+
class InventoryMinimal(EntityMinimalWithIntId[Inventory]):
|
|
10
|
+
_inventoryName: Optional[str] = None
|
|
11
|
+
|
|
12
|
+
@property
|
|
13
|
+
def inventoryName(self) -> Optional[str]:
|
|
14
|
+
return self._inventoryName
|
|
15
|
+
|
|
16
|
+
@inventoryName.setter
|
|
17
|
+
def inventoryName(self, value):
|
|
18
|
+
self._inventoryName = self.checkAndConvert(
|
|
19
|
+
value, str, "inventoryName", allowNone=True
|
|
20
|
+
)
|
|
@@ -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
|
+
pass
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class InventoryRelations(EntityRelations):
|
|
11
|
+
"""Relations of a Inventory with other entities"""
|
|
12
|
+
|
|
13
|
+
_labNotebookEntries: Optional[EntityRelation] = None
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def labNotebookEntries(self) -> Optional[EntityRelation]:
|
|
17
|
+
return self._labNotebookEntries
|
|
18
|
+
|
|
19
|
+
@labNotebookEntries.setter
|
|
20
|
+
def labNotebookEntries(self, value):
|
|
21
|
+
self._labNotebookEntries = self.checkAndConvertNullable(
|
|
22
|
+
value, EntityRelation, "labNotebookEntries"
|
|
23
|
+
)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from enum import Enum
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from LOGS.Entity.EntityRequestParameter import EntityRequestParameter
|
|
6
|
+
from LOGS.Interfaces.ICreationRecord import ICreationRecordRequest
|
|
7
|
+
from LOGS.Interfaces.IHierarchyType import IHierarchyTypeRequest
|
|
8
|
+
from LOGS.Interfaces.IModificationRecord import IModificationRecordRequest
|
|
9
|
+
from LOGS.Interfaces.IPaginationRequest import IPaginationRequest
|
|
10
|
+
from LOGS.Interfaces.IPermissionedEntity import IPermissionedEntityRequest
|
|
11
|
+
from LOGS.Interfaces.IProjectBased import IProjectBasedRequest
|
|
12
|
+
from LOGS.Interfaces.ISoftDeletable import ISoftDeletableRequest
|
|
13
|
+
from LOGS.Interfaces.ITypedEntity import ITypedEntityRequest
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class InventoryOrder(Enum):
|
|
17
|
+
ID_ASC = "ID_ASC"
|
|
18
|
+
ID_DESC = "ID_DESC"
|
|
19
|
+
NAME_ASC = "NAME_ASC"
|
|
20
|
+
NAME_DESC = "NAME_DESC"
|
|
21
|
+
CREATED_ON_ASC = "CREATED_ON_ASC"
|
|
22
|
+
CREATED_ON_DESC = "CREATED_ON_DESC"
|
|
23
|
+
CREATED_BY_ASC = "CREATED_BY_ASC"
|
|
24
|
+
CREATED_BY_DESC = "CREATED_BY_DESC"
|
|
25
|
+
MODIFIED_ON_ASC = "MODIFIED_ON_ASC"
|
|
26
|
+
MODIFIED_ON_DESC = "MODIFIED_ON_DESC"
|
|
27
|
+
MODIFIED_BY_ASC = "MODIFIED_BY_ASC"
|
|
28
|
+
MODIFIED_BY_DESC = "MODIFIED_BY_DESC"
|
|
29
|
+
NUMBER_OF_ITEMS_ASC = "NUMBER_OF_ITEMS_ASC"
|
|
30
|
+
NUMBER_OF_ITEMS_DESC = "NUMBER_OF_ITEMS_DESC"
|
|
31
|
+
TYPE_ASC = "TYPE_ASC"
|
|
32
|
+
TYPE_DESC = "TYPE_DESC"
|
|
33
|
+
INVENTORY_NAME_ASC = "INVENTORY_NAME_ASC"
|
|
34
|
+
INVENTORY_NAME_DESC = "INVENTORY_NAME_DESC"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@dataclass
|
|
38
|
+
class InventoryRequestParameter(
|
|
39
|
+
EntityRequestParameter[InventoryOrder],
|
|
40
|
+
IPaginationRequest,
|
|
41
|
+
ICreationRecordRequest,
|
|
42
|
+
IModificationRecordRequest,
|
|
43
|
+
ISoftDeletableRequest,
|
|
44
|
+
ITypedEntityRequest,
|
|
45
|
+
IHierarchyTypeRequest,
|
|
46
|
+
IProjectBasedRequest,
|
|
47
|
+
IPermissionedEntityRequest,
|
|
48
|
+
):
|
|
49
|
+
childrenOfParentIds: Optional[List[int]] = None
|
|
50
|
+
descendantsOfIds: Optional[List[int]] = None
|
|
51
|
+
excludeHierarchyChildren: Optional[bool] = None
|
|
52
|
+
isHierarchyRoot: Optional[bool] = None
|
|
53
|
+
inventoryIds: Optional[List[int]] = None
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from LOGS.Auxiliary.Decorators import Endpoint
|
|
4
|
+
from LOGS.Entities.LabNotebookModels import LabNotebookStatus
|
|
5
|
+
from LOGS.Entity.EntityWithIntId import IEntityWithIntId
|
|
6
|
+
from LOGS.Interfaces.INamedEntity import INamedEntity
|
|
7
|
+
from LOGS.Interfaces.IPermissionedEntity import GenericPermissionEntity
|
|
8
|
+
from LOGS.Interfaces.IProjectBased import IProjectBased
|
|
9
|
+
from LOGS.Interfaces.IVersionedEntity import IVersionedEntity
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@Endpoint("lab_notebooks")
|
|
13
|
+
class LabNotebook(
|
|
14
|
+
IEntityWithIntId,
|
|
15
|
+
INamedEntity,
|
|
16
|
+
GenericPermissionEntity,
|
|
17
|
+
IVersionedEntity,
|
|
18
|
+
IProjectBased,
|
|
19
|
+
):
|
|
20
|
+
_description: Optional[str] = None
|
|
21
|
+
_status: Optional[LabNotebookStatus] = None
|
|
22
|
+
|
|
23
|
+
@property
|
|
24
|
+
def description(self) -> Optional[str]:
|
|
25
|
+
return self._description
|
|
26
|
+
|
|
27
|
+
@description.setter
|
|
28
|
+
def description(self, value: str):
|
|
29
|
+
self._description = self.checkAndConvertNullable(value, str, "description")
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def status(self) -> Optional[LabNotebookStatus]:
|
|
33
|
+
return self._status
|
|
34
|
+
|
|
35
|
+
@status.setter
|
|
36
|
+
def status(self, value: str):
|
|
37
|
+
self._status = self.checkAndConvertNullable(value, LabNotebookStatus, "status")
|