wizata-dsapi 1.2.5__tar.gz → 1.2.7__tar.gz

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.
Files changed (54) hide show
  1. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/PKG-INFO +1 -1
  2. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/__init__.py +1 -1
  3. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/api_config.py +7 -1
  4. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/request.py +20 -19
  5. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/twin.py +94 -0
  6. wizata_dsapi-1.2.7/wizata_dsapi/version.py +1 -0
  7. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi.egg-info/PKG-INFO +1 -1
  8. wizata_dsapi-1.2.5/wizata_dsapi/version.py +0 -1
  9. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/LICENSE.txt +0 -0
  10. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/README.rst +0 -0
  11. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/setup.cfg +0 -0
  12. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/setup.py +0 -0
  13. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/api_dto.py +0 -0
  14. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/api_interface.py +0 -0
  15. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/bucket.py +0 -0
  16. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/business_label.py +0 -0
  17. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/context.py +0 -0
  18. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/dataframe_toolkit.py +0 -0
  19. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/datapoint.py +0 -0
  20. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/datastore.py +0 -0
  21. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/ds_dataframe.py +0 -0
  22. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/dsapi_json_encoder.py +0 -0
  23. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/evaluation.py +0 -0
  24. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/execution.py +0 -0
  25. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/experiment.py +0 -0
  26. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/group_system.py +0 -0
  27. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/ilogger.py +0 -0
  28. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/insight.py +0 -0
  29. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/mlmodel.py +0 -0
  30. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/model_toolkit.py +0 -0
  31. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/models/__init__.py +0 -0
  32. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/models/common.py +0 -0
  33. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/paged_query_result.py +0 -0
  34. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/pipeline.py +0 -0
  35. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/pipeline_image.py +0 -0
  36. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/plot.py +0 -0
  37. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/plots/__init__.py +0 -0
  38. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/plots/common.py +0 -0
  39. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/script.py +0 -0
  40. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/scripts/__init__.py +0 -0
  41. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/scripts/common.py +0 -0
  42. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/solution_component.py +0 -0
  43. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/streamlit_utils.py +0 -0
  44. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/template.py +0 -0
  45. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/trigger.py +0 -0
  46. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/twinregistration.py +0 -0
  47. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/wizard_function.py +0 -0
  48. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/wizard_request.py +0 -0
  49. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/wizata_dsapi_client.py +0 -0
  50. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi/words.py +0 -0
  51. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi.egg-info/SOURCES.txt +0 -0
  52. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi.egg-info/dependency_links.txt +0 -0
  53. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi.egg-info/requires.txt +0 -0
  54. {wizata_dsapi-1.2.5 → wizata_dsapi-1.2.7}/wizata_dsapi.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wizata_dsapi
3
- Version: 1.2.5
3
+ Version: 1.2.7
4
4
  Summary: Wizata Data Science Toolkit
5
5
  Author: Wizata S.A.
6
6
  Author-email: info@wizata.com
@@ -18,7 +18,7 @@ from .group_system import GroupSystem
18
18
  from .bucket import Bucket
19
19
 
20
20
  # Sql Entities (Dto)
21
- from .twin import Twin, TwinBlockType
21
+ from .twin import Twin, TwinBlockType, TwinType
22
22
  from .datapoint import DataPoint, BusinessType, Label, Unit, Category, InputModeType
23
23
  from .datastore import DataStore
24
24
  from .insight import Insight
@@ -14,7 +14,7 @@ from .solution_component import SolutionComponent
14
14
  from .business_label import BusinessLabel
15
15
  from .twinregistration import TwinRegistration, TwinRegistrationProperty
16
16
  from .trigger import Trigger
17
- from .twin import Twin
17
+ from .twin import Twin, TwinType
18
18
  from .pipeline import Pipeline
19
19
  from .pipeline_image import PipelineImage
20
20
  from .insight import Insight
@@ -147,5 +147,11 @@ _registry = {
147
147
  "class": Twin,
148
148
  "cloud_dsapi": ['lists', 'get_by_id', 'get_by_key', 'create', 'update', 'delete', 'search'],
149
149
  "cloud_context": ['get_by_id', 'get_by_key', 'create', 'update', 'delete', 'search']
150
+ },
151
+ "twintypes":
152
+ {
153
+ "class": TwinType,
154
+ "cloud_dsapi": [ 'get_by_id', 'create', 'update', 'delete'],
155
+ "cloud_context": [ 'get_by_id', 'create', 'update', 'delete' ]
150
156
  }
151
157
  }
@@ -15,25 +15,6 @@ filter_map = {
15
15
  '!=': 'neq'
16
16
  }
17
17
 
18
-
19
- class RequestGroupMap:
20
- """
21
- Define a mapping between a set of datapoints and their corresponding event datapoint.
22
- :ivar event_hardware_id str: hardware id of the datapoint identifying event inside a group.
23
- :ivar event_datapoint: datapoint complete definition corresponding to event_hardware_id.
24
- :ivar datapoints_hardware_ids list: list of all related datapoints.
25
- :ivar datapoints dict: dict with key as hardware id and value datapoint for all mapped datapoints.
26
- """
27
-
28
- def __init__(self,
29
- event_hardware_id: str,
30
- datapoints_hardware_ids: list):
31
- self.event_hardware_id = event_hardware_id
32
- self.datapoints_hardware_ids = datapoints_hardware_ids
33
- self.event_datapoint = None
34
- self.datapoints = {}
35
-
36
-
37
18
  class RequestGroup:
38
19
  """
39
20
  Define a group statement within a structured query.
@@ -87,6 +68,26 @@ class RequestGroup:
87
68
  return group
88
69
 
89
70
 
71
+ class RequestGroupMap:
72
+ """
73
+ Define a mapping between a set of datapoints and their corresponding event datapoint.
74
+ :ivar event_hardware_id str: hardware id of the datapoint identifying event inside a group.
75
+ :ivar event_datapoint: datapoint complete definition corresponding to event_hardware_id.
76
+ :ivar datapoints_hardware_ids list: list of all related datapoints.
77
+ :ivar datapoints dict: dict with key as hardware id and value datapoint for all mapped datapoints.
78
+ """
79
+
80
+ def __init__(self,
81
+ event_hardware_id: str,
82
+ datapoints_hardware_ids: list,
83
+ group: RequestGroup = None):
84
+ self.event_hardware_id = event_hardware_id
85
+ self.datapoints_hardware_ids = datapoints_hardware_ids
86
+ self.event_datapoint = None
87
+ self.datapoints = {}
88
+ self.group = group
89
+
90
+
90
91
  class Request(ApiDto):
91
92
  """
92
93
  request defines how to fetch data from time-series database.
@@ -13,8 +13,96 @@ def is_valid_hex_color(color):
13
13
  return True
14
14
 
15
15
 
16
+ class TwinType(ApiDto):
17
+ """
18
+ twin type
19
+ """
20
+
21
+ @classmethod
22
+ def route(cls):
23
+ return "twintypes"
24
+
25
+ @classmethod
26
+ def from_dict(cls, data):
27
+ obj = TwinType()
28
+ obj.from_json(data)
29
+ return obj
30
+
31
+ def __init__(self,
32
+ twin_type_id: uuid.UUID = None,
33
+ name: str = None,
34
+ icon: str = None,
35
+ color: str = None,
36
+ description: str = None):
37
+ if twin_type_id is None:
38
+ self.twin_type_id = uuid.uuid4()
39
+ else:
40
+ self.twin_type_id = twin_type_id
41
+ self.name = name
42
+ self.icon = icon
43
+ self.color = color
44
+ if color is not None:
45
+ is_valid_hex_color(color)
46
+ self.description = description
47
+ self.createdById = None
48
+ self.createdDate = None
49
+ self.updatedById = None
50
+ self.updatedDate = None
51
+
52
+ def api_id(self) -> str:
53
+ return str(self.twin_type_id).upper()
54
+
55
+ def endpoint(self) -> str:
56
+ return "TwinTypes"
57
+
58
+ def from_json(self, obj):
59
+ if "id" in obj.keys():
60
+ self.twin_type_id = uuid.UUID(obj["id"])
61
+ if "name" in obj.keys() and obj["name"] is not None:
62
+ self.name = obj["name"]
63
+ if "color" in obj.keys() and obj["color"] is not None:
64
+ is_valid_hex_color(str(obj["color"]))
65
+ self.color = str(obj["color"])
66
+ if "icon" in obj.keys() and obj["icon"] is not None:
67
+ self.icon = str(obj["icon"])
68
+ if "description" in obj.keys() and obj["description"] is not None:
69
+ self.description = str(obj["description"])
70
+ if "createdById" in obj.keys() and obj["createdById"] is not None:
71
+ self.createdById = obj["createdById"]
72
+ if "createdDate" in obj.keys() and obj["createdDate"] is not None:
73
+ self.createdDate = obj["createdDate"]
74
+ if "updatedById" in obj.keys() and obj["updatedById"] is not None:
75
+ self.updatedById = obj["updatedById"]
76
+ if "updatedDate" in obj.keys() and obj["updatedDate"] is not None:
77
+ self.updatedDate = obj["updatedDate"]
78
+
79
+ def to_json(self, target: str = None):
80
+ obj = {
81
+ "id": str(self.twin_type_id)
82
+ }
83
+ if self.name is not None:
84
+ obj["name"] = str(self.name)
85
+ if self.color is not None:
86
+ obj["color"] = str(self.color)
87
+ if self.description is not None:
88
+ obj["description"] = str(self.description)
89
+ if self.icon is not None:
90
+ obj["icon"] = str(self.icon)
91
+ if self.createdById is not None:
92
+ obj["createdById"] = str(self.createdById)
93
+ if self.createdDate is not None:
94
+ obj["createdDate"] = str(self.createdDate)
95
+ if self.updatedById is not None:
96
+ obj["updatedById"] = str(self.updatedById)
97
+ if self.updatedDate is not None:
98
+ obj["updatedDate"] = str(self.updatedDate)
99
+ return obj
100
+
101
+
102
+
16
103
  class TwinBlockType(Enum):
17
104
  """
105
+ deprecated - replaced by TwinType
18
106
  digital twin block type
19
107
  - area
20
108
  - machine
@@ -59,6 +147,7 @@ class Twin(ApiDto):
59
147
  return obj
60
148
 
61
149
  def __init__(self, twin_id=None, hardware_id=None, name=None, parent_id=None, ttype=TwinBlockType.MACHINE,
150
+ type_id:uuid.UUID = None,
62
151
  latitude_id: uuid.UUID = None, longitude_id: uuid.UUID = None, color: str = None, icon: str = None,
63
152
  latitude: float = None, longitude: float = None, description: str = None):
64
153
  if twin_id is None:
@@ -69,6 +158,7 @@ class Twin(ApiDto):
69
158
  self.name = name
70
159
  self.parent_id = parent_id
71
160
  self.type = ttype
161
+ self.type_id = type_id
72
162
  self.description = description
73
163
  self.latitude = latitude
74
164
  self.longitude = longitude
@@ -98,6 +188,8 @@ class Twin(ApiDto):
98
188
  self.name = obj["name"]
99
189
  if "parentId" in obj.keys() and obj["parentId"] is not None:
100
190
  self.parent_id = uuid.UUID(obj["parentId"])
191
+ if "twinTypeId" in obj.keys() and obj["twinTypeId"] is not None:
192
+ self.type_id = uuid.UUID(obj["twinTypeId"])
101
193
  if "latitude" in obj.keys() and obj["latitude"] is not None:
102
194
  self.latitude = float(obj["latitude"])
103
195
  if "longitude" in obj.keys() and obj["longitude"] is not None:
@@ -134,6 +226,8 @@ class Twin(ApiDto):
134
226
  obj["name"] = str(self.name)
135
227
  if self.parent_id is not None:
136
228
  obj["parentId"] = str(self.parent_id)
229
+ if self.type_id is not None:
230
+ obj["twinTypeId"] = str(self.type_id)
137
231
  if self.type is not None and isinstance(self.type, TwinBlockType):
138
232
  obj["type"] = self.type.value
139
233
  if self.color is not None:
@@ -0,0 +1 @@
1
+ __version__ = "1.2.7"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wizata-dsapi
3
- Version: 1.2.5
3
+ Version: 1.2.7
4
4
  Summary: Wizata Data Science Toolkit
5
5
  Author: Wizata S.A.
6
6
  Author-email: info@wizata.com
@@ -1 +0,0 @@
1
- __version__ = "1.2.5"
File without changes
File without changes
File without changes
File without changes