logs-py 4.0.7__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.
- LOGS/Auxiliary/CheckClassName.py +1075 -0
- LOGS/Auxiliary/Constants.py +99 -0
- LOGS/Auxiliary/CustomEntityClassGenerator.py +254 -0
- LOGS/Auxiliary/CustomFieldClassGenerator.py +115 -0
- LOGS/Auxiliary/CustomFieldValueTypeChecker.py +168 -0
- LOGS/Auxiliary/CustomSectionClassGenerator.py +113 -0
- LOGS/Auxiliary/CustomTypeClassGenerator.py +147 -0
- LOGS/Auxiliary/DateTimeConverter.py +66 -0
- LOGS/Auxiliary/Decorators.py +109 -0
- LOGS/Auxiliary/Exceptions.py +341 -0
- LOGS/Auxiliary/LOGSErrorResponse.py +89 -0
- LOGS/Auxiliary/MinimalModelGenerator.py +236 -0
- LOGS/Auxiliary/ParameterHelper.py +56 -0
- LOGS/Auxiliary/ReplaceMessage.py +13 -0
- LOGS/Auxiliary/Tools.py +432 -0
- LOGS/Auxiliary/__init__.py +15 -0
- LOGS/Converter/Conversion.py +248 -0
- LOGS/Converter/Converter.py +96 -0
- LOGS/Converter/ConverterParameter.py +88 -0
- LOGS/Converter/DateTimeRange.py +58 -0
- LOGS/Converter/ExportParameters.py +89 -0
- LOGS/Converter/__init__.py +13 -0
- LOGS/Entities/Attachment.py +84 -0
- LOGS/Entities/AttachmentMinimal.py +8 -0
- LOGS/Entities/AttachmentRequestParameter.py +42 -0
- LOGS/Entities/Attachments.py +53 -0
- LOGS/Entities/AutoloadFileInfo.py +12 -0
- LOGS/Entities/AutoloadStatusError.py +7 -0
- LOGS/Entities/AxisNaming.py +33 -0
- LOGS/Entities/AxisZoom.py +33 -0
- LOGS/Entities/Bridge.py +165 -0
- LOGS/Entities/BridgeClientInfo.py +93 -0
- LOGS/Entities/BridgeMinimal.py +8 -0
- LOGS/Entities/BridgeRequestParameter.py +49 -0
- LOGS/Entities/BridgeType.py +7 -0
- LOGS/Entities/Bridges.py +12 -0
- LOGS/Entities/CustomField.py +243 -0
- LOGS/Entities/CustomFieldMinimal.py +8 -0
- LOGS/Entities/CustomFieldModels.py +111 -0
- LOGS/Entities/CustomFieldRequestParameter.py +69 -0
- LOGS/Entities/CustomFieldSearchQuery.py +40 -0
- LOGS/Entities/CustomFields.py +12 -0
- LOGS/Entities/CustomType.py +212 -0
- LOGS/Entities/CustomTypeMinimal.py +8 -0
- LOGS/Entities/CustomTypeRequestParameter.py +60 -0
- LOGS/Entities/CustomTypeSection.py +63 -0
- LOGS/Entities/CustomTypes.py +12 -0
- LOGS/Entities/DataFormat.py +97 -0
- LOGS/Entities/DataFormatInstrument.py +18 -0
- LOGS/Entities/DataFormatInstrumentMinimal.py +8 -0
- LOGS/Entities/DataFormatInstrumentRequestParameter.py +17 -0
- LOGS/Entities/DataFormatInstruments.py +16 -0
- LOGS/Entities/DataFormatMinimal.py +18 -0
- LOGS/Entities/DataFormatRequestParameter.py +21 -0
- LOGS/Entities/DataFormats.py +12 -0
- LOGS/Entities/DataSource.py +218 -0
- LOGS/Entities/DataSourceConnectionStatus.py +12 -0
- LOGS/Entities/DataSourceMinimal.py +8 -0
- LOGS/Entities/DataSourceRequestParameter.py +57 -0
- LOGS/Entities/DataSourceStatus.py +108 -0
- LOGS/Entities/DataSourceStatusIterator.py +16 -0
- LOGS/Entities/DataSourceStatusRequestParameter.py +31 -0
- LOGS/Entities/DataSources.py +12 -0
- LOGS/Entities/Dataset.py +439 -0
- LOGS/Entities/DatasetBase.py +196 -0
- LOGS/Entities/DatasetCreator.py +148 -0
- LOGS/Entities/DatasetInfo.py +147 -0
- LOGS/Entities/DatasetMatchTypes.py +157 -0
- LOGS/Entities/DatasetMatching.py +196 -0
- LOGS/Entities/DatasetMinimal.py +8 -0
- LOGS/Entities/DatasetModels.py +33 -0
- LOGS/Entities/DatasetRequestParameter.py +92 -0
- LOGS/Entities/DatasetTemplate.py +23 -0
- LOGS/Entities/DatasetUploadParameter.py +14 -0
- LOGS/Entities/Datasets.py +142 -0
- LOGS/Entities/Datatrack.py +179 -0
- LOGS/Entities/DatatrackFormattedTable.py +25 -0
- LOGS/Entities/DatatrackGeneric.py +34 -0
- LOGS/Entities/DatatrackImage.py +25 -0
- LOGS/Entities/DatatrackNumericArray.py +30 -0
- LOGS/Entities/DatatrackNumericMatrix.py +98 -0
- LOGS/Entities/Entities.py +71 -0
- LOGS/Entities/EntitiesRequestParameter.py +18 -0
- LOGS/Entities/EntityOriginWriteModelWithId.py +15 -0
- LOGS/Entities/FileEntry.py +138 -0
- LOGS/Entities/FileExcludePattern.py +8 -0
- LOGS/Entities/FormatMetaData.py +56 -0
- 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/HierarchyLeaf.py +15 -0
- LOGS/Entities/HierarchyNode.py +40 -0
- LOGS/Entities/ILiteraryTypedEntity.py +19 -0
- LOGS/Entities/InventoryItem.py +102 -0
- LOGS/Entities/InventoryItemMinimal.py +25 -0
- LOGS/Entities/InventoryItemRequestParameter.py +58 -0
- LOGS/Entities/InventoryItems.py +12 -0
- LOGS/Entities/LabNotebook.py +33 -0
- LOGS/Entities/LabNotebookEntries.py +16 -0
- LOGS/Entities/LabNotebookEntry.py +106 -0
- 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/LabNotebookEntryMinimal.py +8 -0
- LOGS/Entities/LabNotebookEntryRequestParameter.py +59 -0
- LOGS/Entities/LabNotebookExperiment.py +58 -0
- LOGS/Entities/LabNotebookExperimentMinimal.py +8 -0
- LOGS/Entities/LabNotebookExperimentRequestParameter.py +52 -0
- LOGS/Entities/LabNotebookExperiments.py +16 -0
- LOGS/Entities/LabNotebookMinimal.py +8 -0
- LOGS/Entities/LabNotebookModels.py +14 -0
- LOGS/Entities/LabNotebookRequestParameter.py +42 -0
- LOGS/Entities/LabNotebookTemplate.py +42 -0
- LOGS/Entities/LabNotebookTemplateMinimal.py +8 -0
- LOGS/Entities/LabNotebookTemplateRequestParameter.py +38 -0
- LOGS/Entities/LabNotebookTemplates.py +16 -0
- LOGS/Entities/LabNotebooks.py +12 -0
- LOGS/Entities/Method.py +66 -0
- LOGS/Entities/MethodMinimal.py +8 -0
- LOGS/Entities/MethodRequestParameter.py +16 -0
- LOGS/Entities/Methods.py +12 -0
- LOGS/Entities/Origin.py +53 -0
- LOGS/Entities/OriginMinimal.py +8 -0
- LOGS/Entities/OriginRequestParameter.py +28 -0
- LOGS/Entities/Origins.py +12 -0
- LOGS/Entities/ParserLog.py +49 -0
- LOGS/Entities/Permission.py +9 -0
- LOGS/Entities/Person.py +145 -0
- LOGS/Entities/PersonCategory.py +12 -0
- LOGS/Entities/PersonMinimal.py +8 -0
- LOGS/Entities/PersonRequestParameter.py +58 -0
- LOGS/Entities/Persons.py +12 -0
- LOGS/Entities/Project.py +52 -0
- LOGS/Entities/ProjectMinimal.py +8 -0
- LOGS/Entities/ProjectPersonPermission.py +102 -0
- LOGS/Entities/ProjectRequestParameter.py +58 -0
- LOGS/Entities/Projects.py +12 -0
- LOGS/Entities/Role.py +94 -0
- LOGS/Entities/RoleMinimal.py +8 -0
- LOGS/Entities/RoleRequestParameter.py +40 -0
- LOGS/Entities/Roles.py +12 -0
- LOGS/Entities/RunState.py +9 -0
- LOGS/Entities/Sample.py +53 -0
- LOGS/Entities/SampleMinimal.py +8 -0
- LOGS/Entities/SampleRequestParameter.py +54 -0
- LOGS/Entities/Samples.py +12 -0
- LOGS/Entities/SharedContent.py +87 -0
- LOGS/Entities/SharedContentMinimal.py +8 -0
- LOGS/Entities/SharedContentRequestParameter.py +38 -0
- LOGS/Entities/SharedContents.py +12 -0
- LOGS/Entities/Signature.py +60 -0
- LOGS/Entities/Track.py +93 -0
- LOGS/Entities/TrackData.py +20 -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/TrackSettings.py +55 -0
- LOGS/Entities/TrackTable.py +21 -0
- LOGS/Entities/TrackTableData.py +22 -0
- LOGS/Entities/TrackXY.py +40 -0
- LOGS/Entities/TrackXYComplex.py +51 -0
- LOGS/Entities/TrackXYComplexData.py +50 -0
- LOGS/Entities/TrackXYData.py +31 -0
- LOGS/Entities/Vendor.py +40 -0
- LOGS/Entities/VendorMinimal.py +8 -0
- LOGS/Entities/VendorRequestParameter.py +17 -0
- LOGS/Entities/Vendors.py +12 -0
- LOGS/Entities/__init__.py +118 -0
- LOGS/Entity/ConnectedEntity.py +170 -0
- LOGS/Entity/Entity.py +203 -0
- LOGS/Entity/EntityConnector.py +70 -0
- LOGS/Entity/EntityIterator.py +263 -0
- LOGS/Entity/EntityMinimal.py +141 -0
- LOGS/Entity/EntityMinimalWithIntId.py +36 -0
- LOGS/Entity/EntityMinimalWithStrId.py +36 -0
- LOGS/Entity/EntityMinimalWithType.py +47 -0
- LOGS/Entity/EntityRequestParameter.py +104 -0
- LOGS/Entity/EntitySortBy.py +69 -0
- LOGS/Entity/EntityWithIntId.py +26 -0
- LOGS/Entity/EntityWithStrId.py +26 -0
- LOGS/Entity/IGenericEntityOrderBy.py +55 -0
- LOGS/Entity/IdIterator.py +207 -0
- LOGS/Entity/SerializableContent.py +834 -0
- LOGS/Entity/__init__.py +23 -0
- LOGS/Interfaces/ICustomFieldValue.py +92 -0
- LOGS/Interfaces/ICustomSectionValue.py +161 -0
- LOGS/Interfaces/ICustomTypeValue.py +152 -0
- LOGS/Interfaces/ICustomValue.py +28 -0
- LOGS/Interfaces/IEntityInterface.py +7 -0
- LOGS/Interfaces/IEntryRecord.py +57 -0
- LOGS/Interfaces/IHierarchicalEntity.py +41 -0
- LOGS/Interfaces/IHierarchyType.py +63 -0
- LOGS/Interfaces/ILockableEntity.py +52 -0
- LOGS/Interfaces/IModificationRecord.py +56 -0
- LOGS/Interfaces/INamedEntity.py +25 -0
- LOGS/Interfaces/IOwnedEntity.py +27 -0
- LOGS/Interfaces/IPaginationRequest.py +11 -0
- LOGS/Interfaces/IPermissionedEntity.py +72 -0
- LOGS/Interfaces/IProjectBased.py +27 -0
- LOGS/Interfaces/ISessionedEntity.py +59 -0
- LOGS/Interfaces/ISignableEntity.py +49 -0
- LOGS/Interfaces/ISoftDeletable.py +28 -0
- LOGS/Interfaces/ITypedEntity.py +129 -0
- LOGS/Interfaces/IUniqueEntity.py +61 -0
- LOGS/Interfaces/IVersionedEntity.py +39 -0
- LOGS/Interfaces/__init__.py +7 -0
- LOGS/LOGS.py +1436 -0
- LOGS/LOGSConnection.py +647 -0
- LOGS/LOGSOptions.py +11 -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/ServerMetaData.py +120 -0
- LOGS/__init__.py +12 -0
- logs_py-4.0.7.dist-info/METADATA +51 -0
- logs_py-4.0.7.dist-info/RECORD +251 -0
- logs_py-4.0.7.dist-info/WHEEL +5 -0
- logs_py-4.0.7.dist-info/top_level.txt +1 -0
LOGS/Parameters/Color.py
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
|
|
3
|
+
from LOGS.Entity.SerializableContent import SerializableContent
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SingleColor(SerializableContent):
|
|
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(SerializableContent):
|
|
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.SerializableContent import SerializableContent
|
|
4
|
+
from LOGS.Parameters.Color import Color
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ParameterBase(SerializableContent):
|
|
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/ServerMetaData.py
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from uuid import UUID
|
|
4
|
+
|
|
5
|
+
from LOGS.Entity.SerializableContent import SerializableContent
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ServerMetaData(SerializableContent):
|
|
9
|
+
_application: Optional[str] = None
|
|
10
|
+
_vendor: Optional[str] = None
|
|
11
|
+
_version: Optional[str] = None
|
|
12
|
+
_uid: Optional[UUID] = None
|
|
13
|
+
_apiVersion: Optional[str] = None
|
|
14
|
+
_edition: Optional[str] = None
|
|
15
|
+
_groups: Optional[int] = None
|
|
16
|
+
_licensedTo: Optional[str] = None
|
|
17
|
+
_daysUntilExpiration: Optional[int] = None
|
|
18
|
+
_expirationDate: Optional[datetime] = None
|
|
19
|
+
_homepage: Optional[str] = None
|
|
20
|
+
_email: Optional[str] = None
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def application(self) -> Optional[str]:
|
|
24
|
+
return self._application
|
|
25
|
+
|
|
26
|
+
@application.setter
|
|
27
|
+
def application(self, value):
|
|
28
|
+
self._application = self.checkAndConvertNullable(value, str, "application")
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def vendor(self) -> Optional[str]:
|
|
32
|
+
return self._vendor
|
|
33
|
+
|
|
34
|
+
@vendor.setter
|
|
35
|
+
def vendor(self, value):
|
|
36
|
+
self._vendor = self.checkAndConvertNullable(value, str, "vendor")
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def version(self) -> Optional[str]:
|
|
40
|
+
return self._version
|
|
41
|
+
|
|
42
|
+
@version.setter
|
|
43
|
+
def version(self, value):
|
|
44
|
+
self._version = self.checkAndConvertNullable(value, str, "version")
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def uid(self) -> Optional[UUID]:
|
|
48
|
+
return self._uid
|
|
49
|
+
|
|
50
|
+
@uid.setter
|
|
51
|
+
def uid(self, value):
|
|
52
|
+
self._uid = self.checkAndConvertNullable(value, UUID, "uid")
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def apiVersion(self) -> Optional[str]:
|
|
56
|
+
return self._apiVersion
|
|
57
|
+
|
|
58
|
+
@apiVersion.setter
|
|
59
|
+
def apiVersion(self, value):
|
|
60
|
+
self._apiVersion = self.checkAndConvertNullable(value, str, "apiVersion")
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
def edition(self) -> Optional[str]:
|
|
64
|
+
return self._edition
|
|
65
|
+
|
|
66
|
+
@edition.setter
|
|
67
|
+
def edition(self, value):
|
|
68
|
+
self._edition = self.checkAndConvertNullable(value, str, "edition")
|
|
69
|
+
|
|
70
|
+
@property
|
|
71
|
+
def groups(self) -> Optional[int]:
|
|
72
|
+
return self._groups
|
|
73
|
+
|
|
74
|
+
@groups.setter
|
|
75
|
+
def groups(self, value):
|
|
76
|
+
self._groups = self.checkAndConvertNullable(value, int, "groups")
|
|
77
|
+
|
|
78
|
+
@property
|
|
79
|
+
def licensedTo(self) -> Optional[str]:
|
|
80
|
+
return self._licensedTo
|
|
81
|
+
|
|
82
|
+
@licensedTo.setter
|
|
83
|
+
def licensedTo(self, value):
|
|
84
|
+
self._licensedTo = self.checkAndConvertNullable(value, str, "licensedTo")
|
|
85
|
+
|
|
86
|
+
@property
|
|
87
|
+
def daysUntilExpiration(self) -> Optional[int]:
|
|
88
|
+
return self._daysUntilExpiration
|
|
89
|
+
|
|
90
|
+
@daysUntilExpiration.setter
|
|
91
|
+
def daysUntilExpiration(self, value):
|
|
92
|
+
self._daysUntilExpiration = self.checkAndConvertNullable(
|
|
93
|
+
value, int, "daysUntilExpiration"
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
@property
|
|
97
|
+
def expirationDate(self) -> Optional[datetime]:
|
|
98
|
+
return self._expirationDate
|
|
99
|
+
|
|
100
|
+
@expirationDate.setter
|
|
101
|
+
def expirationDate(self, value):
|
|
102
|
+
self._expirationDate = self.checkAndConvertNullable(
|
|
103
|
+
value, datetime, "expirationDate"
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
@property
|
|
107
|
+
def homepage(self) -> Optional[str]:
|
|
108
|
+
return self._homepage
|
|
109
|
+
|
|
110
|
+
@homepage.setter
|
|
111
|
+
def homepage(self, value):
|
|
112
|
+
self._homepage = self.checkAndConvertNullable(value, str, "homepage")
|
|
113
|
+
|
|
114
|
+
@property
|
|
115
|
+
def email(self) -> Optional[str]:
|
|
116
|
+
return self._email
|
|
117
|
+
|
|
118
|
+
@email.setter
|
|
119
|
+
def email(self, value):
|
|
120
|
+
self._email = self.checkAndConvertNullable(value, str, "email")
|
LOGS/__init__.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This Module is written for the LOGS Repository.
|
|
3
|
+
|
|
4
|
+
It's objects can be used to access the LOGS public API
|
|
5
|
+
programmatically via python scripts.
|
|
6
|
+
...
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from .LOGS import *
|
|
10
|
+
from .LOGSConnection import *
|
|
11
|
+
from .LOGSOptions import *
|
|
12
|
+
from .ServerMetaData import *
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: logs-py
|
|
3
|
+
Version: 4.0.7
|
|
4
|
+
Summary: A python interface for the LOGS public API
|
|
5
|
+
Home-page: https://docs.logs-python.com
|
|
6
|
+
Author: Sina Kazemi
|
|
7
|
+
Author-email: support@logs-repository.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
Requires-Dist: numpy
|
|
17
|
+
Requires-Dist: requests
|
|
18
|
+
Requires-Dist: regex>=2019.12.9
|
|
19
|
+
Requires-Dist: Pillow
|
|
20
|
+
Requires-Dist: deprecation
|
|
21
|
+
Requires-Dist: pytz
|
|
22
|
+
Requires-Dist: tzlocal; platform_system == "Windows"
|
|
23
|
+
Requires-Dist: typing_extensions
|
|
24
|
+
Dynamic: author
|
|
25
|
+
Dynamic: author-email
|
|
26
|
+
Dynamic: classifier
|
|
27
|
+
Dynamic: description
|
|
28
|
+
Dynamic: description-content-type
|
|
29
|
+
Dynamic: home-page
|
|
30
|
+
Dynamic: license
|
|
31
|
+
Dynamic: requires-dist
|
|
32
|
+
Dynamic: requires-python
|
|
33
|
+
Dynamic: summary
|
|
34
|
+
|
|
35
|
+
# LOGS-Py
|
|
36
|
+
|
|
37
|
+
LOGS is a scientific data management system (SDMS) software allowing for automated data collection, visualization, and organization. Within its internal organizational concepts it allows you to enrich you experimental data with metadata. LOGS allows you to adapt many of its organization structures which enables your data management to follow your internal workflows.
|
|
38
|
+
|
|
39
|
+
**LOGS-Py is a Python package** interacting with the LOGS web API to enable you to extract and push data to LOGS and generally operateinteract with the LOGS backend in a programatic way. The main motivation behind in the desing of library is to keep this interaction as pythonic as possible. The communication with the API remains mainly in the background while the user of the library handles native Python objects whereby theuser is still able to interact with nearly are LOGS functionalities and entities.
|
|
40
|
+
|
|
41
|
+
Thus _this library_ firstly _targets lab and data scientist_ allowing them to freely interact with experimental data and its meta-data without any pre-knowledge of Web technologies and communication. Secondly, it _facilitates power-users_ to implement highly specific workflows automations and 3rd-party software intergrations with LOGS and other lab software.
|
|
42
|
+
|
|
43
|
+
## Installation
|
|
44
|
+
|
|
45
|
+
The **LOGS-Py** package can be easily installed by using `pip`.
|
|
46
|
+
|
|
47
|
+
For this open the `terminal` and do:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install logs-py
|
|
51
|
+
```
|