wizata-dsapi 1.2.24__py3-none-any.whl → 1.2.25__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.
wizata_dsapi/template.py CHANGED
@@ -1,5 +1,6 @@
1
1
  import uuid
2
2
  import json
3
+ from typing import Optional
3
4
 
4
5
  from .api_dto import ApiDto, VarType
5
6
 
@@ -243,7 +244,8 @@ class Template(ApiDto):
243
244
  p_type: VarType,
244
245
  required: bool = True,
245
246
  template_property_id: uuid.UUID = None,
246
- description: str = None):
247
+ description: str = None,
248
+ unit_id: uuid.UUID = None):
247
249
  """
248
250
  add a property to the template.
249
251
  :param str name: name of the property.
@@ -251,6 +253,7 @@ class Template(ApiDto):
251
253
  :param bool required: set if property is required (default: true)
252
254
  :param uuid.UUID template_property_id: technical id of the template property.
253
255
  :param str description: additional information as a description.
256
+ :param uuid.UUID unit_id: unique identifier of unit for datapoint property.
254
257
  """
255
258
 
256
259
  if self.properties is None:
@@ -264,7 +267,8 @@ class Template(ApiDto):
264
267
  name=name,
265
268
  p_type=p_type,
266
269
  required=required,
267
- description=description
270
+ description=description,
271
+ unit_id=unit_id
268
272
  )
269
273
  property_value.template_id = self.template_id
270
274
 
@@ -275,7 +279,7 @@ class Template(ApiDto):
275
279
 
276
280
  self.properties.append(property_value)
277
281
 
278
- def get_property(self, property_name) -> TemplateProperty:
282
+ def get_property(self, property_name) -> Optional[TemplateProperty]:
279
283
  """
280
284
  get a property from its name.
281
285
  :param property_name: name of the property.
@@ -284,6 +288,7 @@ class Template(ApiDto):
284
288
  for t_property in self.properties:
285
289
  if t_property.name == property_name:
286
290
  return t_property
291
+ return None
287
292
 
288
293
  def add_property(self, property_value):
289
294
  """
@@ -317,11 +322,16 @@ class Template(ApiDto):
317
322
  if "description" in property_value:
318
323
  description = property_value["description"]
319
324
 
325
+ unit_id = None
326
+ if "unitId" in property_value and property_value["unitId"] is not None:
327
+ unit_id = uuid.UUID(property_value["unitId"])
328
+
320
329
  self.add(template_property_id=template_property_id,
321
330
  name=name,
322
331
  p_type=p_type,
323
332
  required=required,
324
- description=description)
333
+ description=description,
334
+ unit_id=unit_id)
325
335
  elif isinstance(property_value, TemplateProperty):
326
336
  property_value.template_id = self.template_id
327
337
 
wizata_dsapi/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.2.24"
1
+ __version__ = "1.2.25"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wizata-dsapi
3
- Version: 1.2.24
3
+ Version: 1.2.25
4
4
  Summary: Wizata Data Science Toolkit
5
5
  Author: Wizata S.A.
6
6
  Author-email: info@wizata.com
@@ -27,11 +27,11 @@ wizata_dsapi/request.py,sha256=qHh1-DQri2Vh17069fHmLlrF5vjNTvA4jmD6mYjg2w8,26515
27
27
  wizata_dsapi/script.py,sha256=DeEciwVpuCYZetgJCoivw_bYe8ma52WuTaTQ_VkLEcg,12930
28
28
  wizata_dsapi/solution_component.py,sha256=8gbZWx2h_xUqI_pAXa3goqAnR5Y-GDMii8MeGlaK1IE,9531
29
29
  wizata_dsapi/streamlit_utils.py,sha256=sXBdygktbixV828Zg01Nl27_a4F8zGFc4RY0C8g-1bc,1942
30
- wizata_dsapi/template.py,sha256=kjfzOgS_ngUMjmptsdmo9xFQp5chEjEuz1xGXW_5FUI,13282
30
+ wizata_dsapi/template.py,sha256=wtCRKKk3PchH4RrNgNYlEF_9C6bzZwKIeLyEvgv6Fdo,13704
31
31
  wizata_dsapi/trigger.py,sha256=w3BZYP-L3SUwvaT0oCTanh_Ewn57peZvlt7vxzHv9J8,5129
32
32
  wizata_dsapi/twin.py,sha256=S0DUzQf1smZXZTdXpXZPtkZYCfKIhw53EecCnsl9i4Q,11017
33
33
  wizata_dsapi/twinregistration.py,sha256=Mi6-YuwroiEXc0c1hgrOaphh4hNVoHupxOnXedVtJtE,13377
34
- wizata_dsapi/version.py,sha256=rRcFnLqwG22zZ399qswskAE5L_if50hEsd_TKzGcrZ4,23
34
+ wizata_dsapi/version.py,sha256=9j001fhDZzLSWs6YCbGQFuK5ERX5EUWz3RKLN8l5JS8,23
35
35
  wizata_dsapi/wizard_function.py,sha256=RbM7W7Gf-6Rhp_1dU9DBYkHaciknGAGvuAndhAS_vyo,942
36
36
  wizata_dsapi/wizard_request.py,sha256=v6BaqKLKvTWmUSo0_gda9FabAQz5x_-GOH1Av50GzFo,3762
37
37
  wizata_dsapi/wizata_dsapi_client.py,sha256=6URQeMA5A9eXxC2cs8TUbKolmOo-Kj6kII9NmRRITPQ,78702
@@ -42,8 +42,8 @@ wizata_dsapi/plots/__init__.py,sha256=qgnSFqrjOPur-807M8uh5awIfjM1ZHXUXcAqHc-r2l
42
42
  wizata_dsapi/plots/common.py,sha256=jdPsJqLHBwSKc6dX83BSGPqSRxzIVNHSYO5yI_8sjGk,6568
43
43
  wizata_dsapi/scripts/__init__.py,sha256=hAxiETSQf0qOHde1si1tEAJU48seqEgHrchCzS2-LvQ,80
44
44
  wizata_dsapi/scripts/common.py,sha256=efwq-Rd0lvYljIs3gSFz9izogBD7asOU2cTK-IvHTkM,4244
45
- wizata_dsapi-1.2.24.dist-info/LICENSE.txt,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
46
- wizata_dsapi-1.2.24.dist-info/METADATA,sha256=Q6qIHMfhunIEQbj8f4vUaYf8vNxMx2Y5eKwTFz4Oj4Q,2188
47
- wizata_dsapi-1.2.24.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
48
- wizata_dsapi-1.2.24.dist-info/top_level.txt,sha256=-OeTJbEnh5DuWyTOHtvw0Dw3LRg3G27TNS6W4ZtfwPs,13
49
- wizata_dsapi-1.2.24.dist-info/RECORD,,
45
+ wizata_dsapi-1.2.25.dist-info/LICENSE.txt,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
46
+ wizata_dsapi-1.2.25.dist-info/METADATA,sha256=hWT2ESQIOnGzoOoXklVARi5LoeEYuL0Sf0IKCU60_YM,2188
47
+ wizata_dsapi-1.2.25.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
48
+ wizata_dsapi-1.2.25.dist-info/top_level.txt,sha256=-OeTJbEnh5DuWyTOHtvw0Dw3LRg3G27TNS6W4ZtfwPs,13
49
+ wizata_dsapi-1.2.25.dist-info/RECORD,,