logs-py 2.9.5__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 +98 -93
- 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 +276 -138
- 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/FormatMethod.py +2 -2
- 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 +50 -27
- 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 +10 -6
- 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 +127 -45
- LOGS/Interfaces/IHierarchyType.py +63 -0
- LOGS/Interfaces/IPermissionedEntity.py +29 -5
- LOGS/Interfaces/IProjectBased.py +1 -1
- LOGS/Interfaces/IRelatedEntity.py +3 -2
- LOGS/Interfaces/ITypedEntity.py +69 -12
- LOGS/Interfaces/IVersionedEntity.py +39 -0
- LOGS/LOGS.py +140 -48
- 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.5.dist-info → logs_py-3.0.0.dist-info}/METADATA +3 -2
- logs_py-3.0.0.dist-info/RECORD +263 -0
- {logs_py-2.9.5.dist-info → logs_py-3.0.0.dist-info}/WHEEL +1 -1
- 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.5.dist-info/RECORD +0 -183
- {logs_py-2.9.5.dist-info → logs_py-3.0.0.dist-info}/top_level.txt +0 -0
LOGS/Parameters/Color.py
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
|
|
3
|
+
from LOGS.Entity.SerializeableContent import SerializeableContent
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SingleColor(SerializeableContent):
|
|
7
|
+
_color: str
|
|
8
|
+
_offset: Optional[float]
|
|
9
|
+
_value: Optional[float]
|
|
10
|
+
|
|
11
|
+
@classmethod
|
|
12
|
+
def bgrIntSigned32bit_to_hexcolor(cls, bgrInt: int):
|
|
13
|
+
b = bgrInt & 2**8 - 1
|
|
14
|
+
g = (bgrInt >> 8) & 2**8 - 1
|
|
15
|
+
r = (bgrInt >> 16) & 2**8 - 1
|
|
16
|
+
return "#%02x%02x%02x" % (r, g, b)
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def color(self) -> str:
|
|
20
|
+
return self._color
|
|
21
|
+
|
|
22
|
+
@color.setter
|
|
23
|
+
def color(self, value):
|
|
24
|
+
self._color = value
|
|
25
|
+
|
|
26
|
+
@property
|
|
27
|
+
def offset(self) -> Optional[float]:
|
|
28
|
+
return self._offset
|
|
29
|
+
|
|
30
|
+
@offset.setter
|
|
31
|
+
def offset(self, value):
|
|
32
|
+
value = self.checkAndConvert(
|
|
33
|
+
value, fieldName="offset", fieldType=float, allowNone=True
|
|
34
|
+
)
|
|
35
|
+
if value < 0:
|
|
36
|
+
raise Exception("Color offset value must be >= 0. (Got %f)" % value)
|
|
37
|
+
if value > 1:
|
|
38
|
+
raise Exception("Color offset value must be <= 1. (Got %f)" % value)
|
|
39
|
+
self._offset = value
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def value(self) -> Optional[float]:
|
|
43
|
+
return self._value
|
|
44
|
+
|
|
45
|
+
@value.setter
|
|
46
|
+
def value(self, value):
|
|
47
|
+
self._value = value
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class Color(SerializeableContent):
|
|
51
|
+
_colors: List[SingleColor]
|
|
52
|
+
_discrete: Optional[bool]
|
|
53
|
+
_reverse: Optional[bool]
|
|
54
|
+
|
|
55
|
+
def __init__(self, ref=None):
|
|
56
|
+
if ref != None:
|
|
57
|
+
if isinstance(ref, str):
|
|
58
|
+
ref = {"colors": [ref]}
|
|
59
|
+
elif isinstance(ref, list):
|
|
60
|
+
ref = {"colors": ref}
|
|
61
|
+
|
|
62
|
+
super().__init__(ref)
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def bgrIntSigned32bit_to_hexcolor(cls, bgrInt: int):
|
|
66
|
+
return SingleColor.bgrIntSigned32bit_to_hexcolor(bgrInt=bgrInt)
|
|
67
|
+
|
|
68
|
+
@property
|
|
69
|
+
def colors(self) -> List[SingleColor]:
|
|
70
|
+
return self._colors
|
|
71
|
+
|
|
72
|
+
@colors.setter
|
|
73
|
+
def colors(self, value):
|
|
74
|
+
self._colors = self.checkListAndConvert(
|
|
75
|
+
value, fieldType=SingleColor, fieldName="colors"
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
@property
|
|
79
|
+
def discrete(self) -> Optional[bool]:
|
|
80
|
+
return self._discrete
|
|
81
|
+
|
|
82
|
+
@discrete.setter
|
|
83
|
+
def discrete(self, value):
|
|
84
|
+
self._discrete = bool(value)
|
|
85
|
+
|
|
86
|
+
@property
|
|
87
|
+
def reverse(self) -> Optional[bool]:
|
|
88
|
+
return self._reverse
|
|
89
|
+
|
|
90
|
+
@reverse.setter
|
|
91
|
+
def reverse(self, value):
|
|
92
|
+
self._reverse = bool(value)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
|
|
3
|
+
from LOGS.Entity.SerializeableContent import SerializeableContent
|
|
4
|
+
from LOGS.Parameters.Color import Color
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ParameterBase(SerializeableContent):
|
|
8
|
+
_name: str = ""
|
|
9
|
+
_tracks: Optional[List[str]] = None
|
|
10
|
+
_colors: List[Color] = []
|
|
11
|
+
_active: bool = True
|
|
12
|
+
_type: str = "None"
|
|
13
|
+
|
|
14
|
+
@property
|
|
15
|
+
def name(self) -> str:
|
|
16
|
+
return self._name
|
|
17
|
+
|
|
18
|
+
@name.setter
|
|
19
|
+
def name(self, value):
|
|
20
|
+
self._name = self.checkAndConvert(value, fieldType=str, fieldName="name")
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def tracks(self) -> Optional[List[str]]:
|
|
24
|
+
return self._tracks
|
|
25
|
+
|
|
26
|
+
@tracks.setter
|
|
27
|
+
def tracks(self, value):
|
|
28
|
+
self._tracks = self.checkListAndConvert(
|
|
29
|
+
value, fieldType=str, fieldName="tracks"
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def active(self) -> bool:
|
|
34
|
+
return self._active
|
|
35
|
+
|
|
36
|
+
@active.setter
|
|
37
|
+
def active(self, value):
|
|
38
|
+
self._active = bool(value)
|
|
39
|
+
|
|
40
|
+
@property
|
|
41
|
+
def colors(self) -> Optional[List[Color]]:
|
|
42
|
+
if len(self._colors) < 1:
|
|
43
|
+
return None
|
|
44
|
+
|
|
45
|
+
return self._colors
|
|
46
|
+
|
|
47
|
+
@colors.setter
|
|
48
|
+
def colors(self, value):
|
|
49
|
+
self._colors = self.checkListAndConvert(
|
|
50
|
+
value, fieldType=Color, fieldName="colors"
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def type(self) -> str:
|
|
55
|
+
return self._type
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from typing import cast
|
|
2
|
+
|
|
3
|
+
from LOGS.Parameters.ParameterBase import ParameterBase
|
|
4
|
+
from LOGS.Parameters.ParameterElement import ParameterElement
|
|
5
|
+
from LOGS.Parameters.ParameterList import ParameterList
|
|
6
|
+
from LOGS.Parameters.ParameterTable import ParameterTable
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ParameterConverter:
|
|
10
|
+
@classmethod
|
|
11
|
+
def convert(cls, parameter):
|
|
12
|
+
if not isinstance(parameter, dict) or "type" not in parameter:
|
|
13
|
+
return cast(ParameterBase, None)
|
|
14
|
+
|
|
15
|
+
if parameter["type"] == "parameter":
|
|
16
|
+
return ParameterElement(parameter)
|
|
17
|
+
|
|
18
|
+
if parameter["type"] == "list":
|
|
19
|
+
return ParameterList(parameter)
|
|
20
|
+
|
|
21
|
+
if parameter["type"] == "table":
|
|
22
|
+
return ParameterTable(parameter)
|
|
23
|
+
|
|
24
|
+
return cast(ParameterBase, None)
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
from typing import List, Literal, Optional, Union
|
|
2
|
+
|
|
3
|
+
from LOGS.Parameters.ParameterBase import ParameterBase
|
|
4
|
+
|
|
5
|
+
VTypeType = Literal["int", "float", "int[]", "float[]", "str"]
|
|
6
|
+
ValueType = Union[str, int, float, List[int], List[float], None]
|
|
7
|
+
FormatterType = Literal[
|
|
8
|
+
"duration",
|
|
9
|
+
"length",
|
|
10
|
+
"voltage",
|
|
11
|
+
"current",
|
|
12
|
+
"pressure",
|
|
13
|
+
"frequency",
|
|
14
|
+
"magnetic",
|
|
15
|
+
"epower",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ParameterElement(ParameterBase):
|
|
20
|
+
_type = "parameter"
|
|
21
|
+
|
|
22
|
+
_vtype: VTypeType = "str"
|
|
23
|
+
_value: ValueType = None
|
|
24
|
+
_formatter: Optional[FormatterType] = None
|
|
25
|
+
_unit: Optional[str] = None
|
|
26
|
+
_delimiter: Optional[str] = None
|
|
27
|
+
_decimalPlaces: Optional[int] = None
|
|
28
|
+
_multiline: Optional[bool] = None
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def vtype(self) -> VTypeType:
|
|
32
|
+
return self._vtype
|
|
33
|
+
|
|
34
|
+
@vtype.setter
|
|
35
|
+
def vtype(self, value):
|
|
36
|
+
self._vtype = value
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def value(self) -> ValueType:
|
|
40
|
+
return self._value
|
|
41
|
+
|
|
42
|
+
@value.setter
|
|
43
|
+
def value(self, value):
|
|
44
|
+
self._value = value
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def formattedValue(self) -> str:
|
|
48
|
+
if self._unit:
|
|
49
|
+
return str(self._value) + " " + self._unit
|
|
50
|
+
|
|
51
|
+
return str(self._value)
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def formatter(self) -> Optional[FormatterType]:
|
|
55
|
+
return self._formatter
|
|
56
|
+
|
|
57
|
+
@formatter.setter
|
|
58
|
+
def formatter(self, value):
|
|
59
|
+
self._formatter = value
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def unit(self) -> Optional[str]:
|
|
63
|
+
return self._unit
|
|
64
|
+
|
|
65
|
+
@unit.setter
|
|
66
|
+
def unit(self, value):
|
|
67
|
+
self._unit = value
|
|
68
|
+
|
|
69
|
+
@property
|
|
70
|
+
def multiline(self) -> Optional[bool]:
|
|
71
|
+
return self._multiline
|
|
72
|
+
|
|
73
|
+
@multiline.setter
|
|
74
|
+
def multiline(self, value):
|
|
75
|
+
self._multiline = value
|
|
76
|
+
|
|
77
|
+
@property
|
|
78
|
+
def delimiter(self) -> Optional[str]:
|
|
79
|
+
return self._delimiter
|
|
80
|
+
|
|
81
|
+
@delimiter.setter
|
|
82
|
+
def delimiter(self, value):
|
|
83
|
+
self._delimiter = value
|
|
84
|
+
|
|
85
|
+
@property
|
|
86
|
+
def decimalPlaces(self) -> Optional[int]:
|
|
87
|
+
return self._decimalPlaces
|
|
88
|
+
|
|
89
|
+
@decimalPlaces.setter
|
|
90
|
+
def decimalPlaces(self, value):
|
|
91
|
+
value = self.checkAndConvert(
|
|
92
|
+
value, fieldName="decimalPlaces", fieldType=int, allowNone=True
|
|
93
|
+
)
|
|
94
|
+
if value < 0:
|
|
95
|
+
raise Exception(
|
|
96
|
+
"Decimal places must be zero or a positive integer number. (Got %a)"
|
|
97
|
+
% value
|
|
98
|
+
)
|
|
99
|
+
self._decimalPlaces = value
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
from typing import Any, List, cast
|
|
2
|
+
|
|
3
|
+
from LOGS.Parameters.ParameterBase import ParameterBase
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ParameterList(ParameterBase):
|
|
7
|
+
_type = "list"
|
|
8
|
+
_content: List[ParameterBase] = []
|
|
9
|
+
|
|
10
|
+
def __init__(self, ref=None):
|
|
11
|
+
if isinstance(ref, list):
|
|
12
|
+
ref = {"name": "<root>", "content": ref}
|
|
13
|
+
|
|
14
|
+
super().__init__(ref)
|
|
15
|
+
|
|
16
|
+
def __iter__(self):
|
|
17
|
+
for c in self._content:
|
|
18
|
+
yield c
|
|
19
|
+
|
|
20
|
+
def findItems(self, name: str) -> list[ParameterBase]:
|
|
21
|
+
return [c for c in self._content if c.name == name]
|
|
22
|
+
|
|
23
|
+
def findItemsRecursively(self, name: str) -> list[ParameterBase]:
|
|
24
|
+
result = self.findItems(name)
|
|
25
|
+
# print([c.name for c in self._content])
|
|
26
|
+
# print("->", [c.name for c in result])
|
|
27
|
+
|
|
28
|
+
for c in self._content:
|
|
29
|
+
if isinstance(c, ParameterList):
|
|
30
|
+
result.extend(c.findItemsRecursively(name))
|
|
31
|
+
|
|
32
|
+
return result
|
|
33
|
+
|
|
34
|
+
@property
|
|
35
|
+
def content(self) -> List[ParameterBase]:
|
|
36
|
+
return self._content
|
|
37
|
+
|
|
38
|
+
@content.setter
|
|
39
|
+
def content(self, value: List[ParameterBase]):
|
|
40
|
+
from LOGS.Parameters.ParameterConverter import ParameterConverter
|
|
41
|
+
|
|
42
|
+
# for e in value:
|
|
43
|
+
# p = ParameterConverter.convert(e)
|
|
44
|
+
# p.printJson()
|
|
45
|
+
# print("-------------------")
|
|
46
|
+
|
|
47
|
+
self._content = self.checkListAndConvert(
|
|
48
|
+
value,
|
|
49
|
+
ParameterBase,
|
|
50
|
+
"content",
|
|
51
|
+
converter=cast(Any, ParameterConverter.convert),
|
|
52
|
+
)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from typing import List, Literal, Optional, Union
|
|
2
|
+
|
|
3
|
+
from LOGS.Parameters.ParameterBase import ParameterBase
|
|
4
|
+
|
|
5
|
+
ColumnTypesType = Literal["int", "float", "str", "bool"]
|
|
6
|
+
TableType = Union[str, int, float, None]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ParameterTable(ParameterBase):
|
|
10
|
+
_type = "table"
|
|
11
|
+
|
|
12
|
+
_columnNumber: int = 0
|
|
13
|
+
_columnTypes: List[ColumnTypesType] = []
|
|
14
|
+
_columnDecimals: List[Optional[int]] = []
|
|
15
|
+
_columnNames: List[str] = []
|
|
16
|
+
_table: List[List[TableType]] = []
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def columnNumber(self) -> int:
|
|
20
|
+
return self._columnNumber
|
|
21
|
+
|
|
22
|
+
@columnNumber.setter
|
|
23
|
+
def columnNumber(self, value):
|
|
24
|
+
if not isinstance(value, int) or value < 0:
|
|
25
|
+
value = 0
|
|
26
|
+
self._columnNumber = value
|
|
27
|
+
|
|
28
|
+
@property
|
|
29
|
+
def columnTypes(self) -> List[ColumnTypesType]:
|
|
30
|
+
return self._columnTypes
|
|
31
|
+
|
|
32
|
+
@columnTypes.setter
|
|
33
|
+
def columnTypes(self, value):
|
|
34
|
+
self._columnTypes = self.checkListAndConvert(
|
|
35
|
+
value, str, fieldName="columnTypes" # type: ignore
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def columnDecimals(self) -> List[Optional[int]]:
|
|
40
|
+
return self._columnDecimals
|
|
41
|
+
|
|
42
|
+
@columnDecimals.setter
|
|
43
|
+
def columnDecimals(self, value):
|
|
44
|
+
self._columnDecimals = self.checkListAndConvert(
|
|
45
|
+
value, fieldType=int, fieldName="columnDecimals", allowNone=True
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
def columnNames(self) -> List[str]:
|
|
50
|
+
return self._columnNames
|
|
51
|
+
|
|
52
|
+
@columnNames.setter
|
|
53
|
+
def columnNames(self, value):
|
|
54
|
+
self._columnNames = self.checkListAndConvert(
|
|
55
|
+
value, fieldType=str, fieldName="columnNames", allowNone=True
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def table(self) -> List[List[TableType]]:
|
|
60
|
+
return self._table
|
|
61
|
+
|
|
62
|
+
@table.setter
|
|
63
|
+
def table(self, value):
|
|
64
|
+
self._table = value
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This package is written for the LOGS Repository.
|
|
3
|
+
|
|
4
|
+
It's objects can be used to write your own dataset parser.
|
|
5
|
+
|
|
6
|
+
License:
|
|
7
|
+
Permission to use this libraray and all of its contents is
|
|
8
|
+
strictly permitted to the Signals Company.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from .Color import *
|
|
12
|
+
from .ParameterBase import *
|
|
13
|
+
from .ParameterElement import *
|
LOGS/__init__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: logs-py
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.0.0
|
|
4
4
|
Summary: A python interface for the LOGS public API
|
|
5
5
|
Home-page: https://docs.logs-python.com
|
|
6
6
|
Author: Sina Kazemi
|
|
@@ -15,9 +15,10 @@ Requires-Python: >=3.8
|
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
Requires-Dist: numpy
|
|
17
17
|
Requires-Dist: requests
|
|
18
|
-
Requires-Dist: regex
|
|
18
|
+
Requires-Dist: regex>=2019.12.9
|
|
19
19
|
Requires-Dist: Pillow
|
|
20
20
|
Requires-Dist: deprecation
|
|
21
|
+
Requires-Dist: pytz
|
|
21
22
|
|
|
22
23
|
# LOGS-Py
|
|
23
24
|
|