wizata-dsapi 1.2.25__py3-none-any.whl → 1.3.1__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/mlmodel.py CHANGED
@@ -16,6 +16,7 @@ class MLModelConfig(ApiDto):
16
16
  a model config defines execution properties within a pipeline.
17
17
  usually to define how a pipeline should train and predict with your model.
18
18
 
19
+ :ivar format: by default 'pkl' for pickle, accept 'pt' for PyTorch model using tensors (none = 'pkl')
19
20
  :ivar bool by_twin: define if pipeline need to train and use different model by twin item.
20
21
  :ivar bool by_property: define if pipeline need to train and use different model based on 'property_name'.
21
22
  :ivar list features: datapoint list to refine columns if necessary.
@@ -39,6 +40,7 @@ class MLModelConfig(ApiDto):
39
40
  train_script=None,
40
41
  train_test_split_pct: float = 1.0,
41
42
  train_test_split_type: str = "ignore",
43
+ format: str = 'pkl',
42
44
  function: str = "predict",
43
45
  properties_mapping=None,
44
46
  target_feat=None,
@@ -74,6 +76,7 @@ class MLModelConfig(ApiDto):
74
76
  self.by_twin = by_twin
75
77
  self.by_property = by_property
76
78
  self.property_name = property_name
79
+ self.format = format
77
80
 
78
81
  # source
79
82
  self.source = source
@@ -156,6 +159,8 @@ class MLModelConfig(ApiDto):
156
159
  self.model_type = obj["model_type"]
157
160
  if "model_alias" in obj.keys() and obj["model_alias"] is not None:
158
161
  self.model_alias = obj["model_alias"]
162
+ if "format" in obj.keys() and obj["format"] is not None:
163
+ self.format = obj["format"]
159
164
 
160
165
  def to_json(self, target: str = None):
161
166
  obj = {
@@ -199,6 +204,8 @@ class MLModelConfig(ApiDto):
199
204
  obj["by_property"] = str(self.by_property)
200
205
  if self.property_name is not None:
201
206
  obj["property_name"] = self.property_name
207
+ if self.format is not None:
208
+ obj["format"] = self.format
202
209
 
203
210
  return obj
204
211
 
wizata_dsapi/request.py CHANGED
@@ -355,6 +355,36 @@ class Request(ApiDto):
355
355
  else:
356
356
  return
357
357
 
358
+ def set_twin(self, twin):
359
+ """
360
+ set a twin properly (str hardware Id or uuid.UUID)
361
+ :param twin:
362
+ :return:
363
+ """
364
+ if self.template is None:
365
+ self.template = {}
366
+ if isinstance(twin, uuid.UUID):
367
+ self.template['twin_id'] = twin
368
+ elif isinstance(twin, str):
369
+ self.template['twin_hardware_id'] = twin
370
+ else:
371
+ raise TypeError('twin must be str or uuid on request')
372
+
373
+ def set_template(self, template):
374
+ """
375
+ set a template properly (str key or uuid.UUID)
376
+ :param template:
377
+ :return:
378
+ """
379
+ if self.template is None:
380
+ self.template = {}
381
+ if isinstance(template, uuid.UUID):
382
+ self.template['template_id'] = template
383
+ elif isinstance(template, str):
384
+ self.template['template_key'] = template
385
+ else:
386
+ raise TypeError('template must be str or uuid on request')
387
+
358
388
  def __format_date(self, dt_to_format):
359
389
  if isinstance(dt_to_format, datetime):
360
390
  millisec = dt_to_format.timestamp() * 1000
@@ -468,22 +498,27 @@ class Request(ApiDto):
468
498
  else:
469
499
  self.template = {}
470
500
 
471
- if template_id is not None:
501
+ template = None
502
+ if template_key is not None:
503
+ template = template_key
504
+ elif template_id is not None:
472
505
  if isinstance(template_id, uuid.UUID):
473
- self.template['template_id'] = template_id
506
+ template = template_id
474
507
  else:
475
- self.template['template_id'] = uuid.UUID(template_id)
476
- elif template_key is not None:
477
- self.template['template_key'] = str(template_key)
478
-
479
- if twin_id is not None:
508
+ template = uuid.UUID(template_id)
509
+ if template is not None:
510
+ self.set_template(template=template)
511
+
512
+ twin = None
513
+ if twin_hardware_id is not None:
514
+ twin = twin_hardware_id
515
+ elif twin_id is not None:
480
516
  if isinstance(twin_id, uuid.UUID):
481
- self.template['twin_id'] = twin_id
517
+ twin = twin_id
482
518
  else:
483
- self.template['twin_id'] = uuid.UUID(twin_id)
484
-
485
- elif twin_hardware_id is not None:
486
- self.template['twin_hardware_id'] = str(twin_hardware_id)
519
+ twin = uuid.UUID(twin_id)
520
+ if twin is not None:
521
+ self.set_twin(twin=twin)
487
522
 
488
523
  def get_params(self):
489
524
  """
wizata_dsapi/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.2.25"
1
+ __version__ = "1.3.1"
@@ -662,11 +662,11 @@ class WizataDSAPIClient(ApiInterface):
662
662
 
663
663
  request.set_aggregation(agg_method, interval)
664
664
 
665
- if template is not None or twin is not None:
666
- request.select_template(
667
- template_key=template,
668
- twin_hardware_id=twin
669
- )
665
+ if twin is not None:
666
+ request.set_twin(twin)
667
+
668
+ if template is not None:
669
+ request.set_template(template)
670
670
 
671
671
  if filters is not None:
672
672
  request.filters = filters
@@ -0,0 +1,67 @@
1
+ Metadata-Version: 2.4
2
+ Name: wizata_dsapi
3
+ Version: 1.3.1
4
+ Summary: Wizata Data Science Toolkit
5
+ Author: Wizata S.A.
6
+ Author-email: info@wizata.com
7
+ License-File: LICENSE.txt
8
+ Requires-Dist: pandas==1.5.3; python_version < "3.12"
9
+ Requires-Dist: pandas>=2.3.3; python_version >= "3.12"
10
+ Requires-Dist: numpy==1.26.4; python_version < "3.12"
11
+ Requires-Dist: numpy>=2.3.3; python_version >= "3.12"
12
+ Requires-Dist: dill==0.3.6; python_version < "3.12"
13
+ Requires-Dist: dill==0.4.0; python_version >= "3.12"
14
+ Requires-Dist: protobuf>=3.20.3
15
+ Requires-Dist: msal==1.24.0; python_version < "3.12"
16
+ Requires-Dist: msal>=1.34.0; python_version >= "3.12"
17
+ Requires-Dist: joblib==1.5.2; python_version < "3.12"
18
+ Requires-Dist: joblib>=1.2.0; python_version >= "3.12"
19
+ Requires-Dist: requests==2.28.2; python_version < "3.12"
20
+ Requires-Dist: requests>=2.32.5; python_version >= "3.12"
21
+ Requires-Dist: setuptools==67.6.0; python_version < "3.12"
22
+ Requires-Dist: setuptools>=80.9.0; python_version >= "3.12"
23
+ Requires-Dist: plotly==5.13.1; python_version < "3.12"
24
+ Requires-Dist: plotly>=6.3.1; python_version >= "3.12"
25
+ Provides-Extra: all
26
+ Requires-Dist: pandas==1.5.3; python_version < "3.12" and extra == "all"
27
+ Requires-Dist: pandas>=2.3.3; python_version >= "3.12" and extra == "all"
28
+ Requires-Dist: numpy==1.26.4; python_version < "3.12" and extra == "all"
29
+ Requires-Dist: numpy>=2.3.3; python_version >= "3.12" and extra == "all"
30
+ Requires-Dist: dill==0.3.6; python_version < "3.12" and extra == "all"
31
+ Requires-Dist: dill==0.4.0; python_version >= "3.12" and extra == "all"
32
+ Requires-Dist: protobuf>=3.20.3; extra == "all"
33
+ Requires-Dist: msal==1.24.0; python_version < "3.12" and extra == "all"
34
+ Requires-Dist: msal>=1.34.0; python_version >= "3.12" and extra == "all"
35
+ Requires-Dist: joblib==1.5.2; python_version < "3.12" and extra == "all"
36
+ Requires-Dist: joblib>=1.2.0; python_version >= "3.12" and extra == "all"
37
+ Requires-Dist: requests==2.28.2; python_version < "3.12" and extra == "all"
38
+ Requires-Dist: requests>=2.32.5; python_version >= "3.12" and extra == "all"
39
+ Requires-Dist: setuptools==67.6.0; python_version < "3.12" and extra == "all"
40
+ Requires-Dist: setuptools>=80.9.0; python_version >= "3.12" and extra == "all"
41
+ Requires-Dist: plotly==5.13.1; python_version < "3.12" and extra == "all"
42
+ Requires-Dist: plotly>=6.3.1; python_version >= "3.12" and extra == "all"
43
+ Requires-Dist: matplotlib==3.7.1; extra == "all"
44
+ Requires-Dist: tensorflow==2.15.0; (sys_platform != "darwin" or platform_machine != "arm64") and extra == "all"
45
+ Requires-Dist: tensorflow-macos==2.15.0; (sys_platform == "darwin" and platform_machine == "arm64") and extra == "all"
46
+ Requires-Dist: keras==2.15.0; (sys_platform != "darwin" or platform_machine != "arm64") and extra == "all"
47
+ Requires-Dist: keras==2.15.0; (sys_platform == "darwin" and platform_machine == "arm64") and extra == "all"
48
+ Requires-Dist: tensorflow_probability==0.15.0; extra == "all"
49
+ Requires-Dist: scikit-learn==1.2.2; extra == "all"
50
+ Requires-Dist: adtk==0.6.2; extra == "all"
51
+ Requires-Dist: scipy==1.10.1; extra == "all"
52
+ Requires-Dist: xgboost==1.7.4; extra == "all"
53
+ Requires-Dist: u8darts==0.25.0; extra == "all"
54
+ Requires-Dist: optuna==3.3.0; extra == "all"
55
+ Requires-Dist: explainerdashboard==0.4.2.1; extra == "all"
56
+ Requires-Dist: ipywidgets==8.0.4; extra == "all"
57
+ Requires-Dist: kaleido==0.2.1; extra == "all"
58
+ Requires-Dist: pytest==7.2.2; extra == "all"
59
+ Requires-Dist: pytest-cov==4.0.0; extra == "all"
60
+ Requires-Dist: shapely==2.0.1; extra == "all"
61
+ Requires-Dist: pyodbc==4.0.35; extra == "all"
62
+ Dynamic: author
63
+ Dynamic: author-email
64
+ Dynamic: license-file
65
+ Dynamic: provides-extra
66
+ Dynamic: requires-dist
67
+ Dynamic: summary
@@ -16,14 +16,14 @@ wizata_dsapi/experiment.py,sha256=QYQ1CJ-MTWsXq08xYbm5sAp95dRxbPOmGDgaAOoBMDQ,46
16
16
  wizata_dsapi/group_system.py,sha256=6rUKe0_J3YWACysyBlzuw_TEpKNXgLOMxhpWsNxOzwY,1708
17
17
  wizata_dsapi/ilogger.py,sha256=iYnID-Z-qrYhie26C43404aIuU4_tHSKXbDeQIdo82Q,807
18
18
  wizata_dsapi/insight.py,sha256=ABFZ04DqYxxzqAEfU1tzlTZqqrigM-zN-8Lbetko3g0,6468
19
- wizata_dsapi/mlmodel.py,sha256=ooVfY5LIHZojhBoZtnz-WGnf95P15md5cgvo3Lg8CG4,14568
19
+ wizata_dsapi/mlmodel.py,sha256=1vd5dHob3LtrjbWjpGr90GyPEcdBKxUQRxExX1OJdWc,14923
20
20
  wizata_dsapi/model_toolkit.py,sha256=a76ckSuetSKDjEkOl7o49g9oaItdw9iOaPt0JcstmhU,1551
21
21
  wizata_dsapi/paged_query_result.py,sha256=0Iyt2Kd4tvrfthhT-tk9EmSERsbJTaPNON2euHcBn6k,1150
22
22
  wizata_dsapi/pipeline.py,sha256=WDJeOxPZJiYW1qwTNZUm3jom2epIxqrSoiUwcrTF9EE,31300
23
23
  wizata_dsapi/pipeline_deployment.py,sha256=grekBaxUK0EhL9w7lDB8vNuW_wzLnHVm9Mq8Lkbkguk,1722
24
24
  wizata_dsapi/pipeline_image.py,sha256=M3FOr45dJIAEvsmXPpMD8JZ09k5-YpW9PRYEWJqptcI,5272
25
25
  wizata_dsapi/plot.py,sha256=SPGKFWWYNcRvHcqvvnPIIIBKsd5UwhdsxLW7b2dG2rs,2360
26
- wizata_dsapi/request.py,sha256=qHh1-DQri2Vh17069fHmLlrF5vjNTvA4jmD6mYjg2w8,26515
26
+ wizata_dsapi/request.py,sha256=W4E1BHacQdJiBLPI96yVeHz41rbfFuGrbuw1U60L_DM,27560
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
@@ -31,10 +31,10 @@ wizata_dsapi/template.py,sha256=wtCRKKk3PchH4RrNgNYlEF_9C6bzZwKIeLyEvgv6Fdo,1370
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=9j001fhDZzLSWs6YCbGQFuK5ERX5EUWz3RKLN8l5JS8,23
34
+ wizata_dsapi/version.py,sha256=-ypEJktJToAL9by62JJKWEzDo_KPCQtmE5kwFgX24z4,22
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
- wizata_dsapi/wizata_dsapi_client.py,sha256=6URQeMA5A9eXxC2cs8TUbKolmOo-Kj6kII9NmRRITPQ,78702
37
+ wizata_dsapi/wizata_dsapi_client.py,sha256=kos_8j47CBXiy6y6b_H2yDUe3aWh76diEmWjCisYKkY,78662
38
38
  wizata_dsapi/words.py,sha256=tV8CqzCqODZCV7PgBxBF5exBxeF_ya9t5DiUy-cg6Sg,1535
39
39
  wizata_dsapi/models/__init__.py,sha256=O5PHqw8lKILw4apO-MfDxPz73wK0vADD9y3xjuzX7Tw,104
40
40
  wizata_dsapi/models/common.py,sha256=1dTqE80-mFJnUwEdNlJdhJzfZ2N5Kp8Nb3LQ8uwPtLc,3808
@@ -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.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,,
45
+ wizata_dsapi-1.3.1.dist-info/licenses/LICENSE.txt,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
46
+ wizata_dsapi-1.3.1.dist-info/METADATA,sha256=36YAYQVzxultH6vkroCN9f_AJ4cSfgv-jLSEzrrHvjk,3635
47
+ wizata_dsapi-1.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
48
+ wizata_dsapi-1.3.1.dist-info/top_level.txt,sha256=-OeTJbEnh5DuWyTOHtvw0Dw3LRg3G27TNS6W4ZtfwPs,13
49
+ wizata_dsapi-1.3.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.38.4)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,46 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: wizata-dsapi
3
- Version: 1.2.25
4
- Summary: Wizata Data Science Toolkit
5
- Author: Wizata S.A.
6
- Author-email: info@wizata.com
7
- License-File: LICENSE.txt
8
- Requires-Dist: pandas (==1.5.3)
9
- Requires-Dist: numpy (==1.26.4)
10
- Requires-Dist: dill (==0.3.6)
11
- Requires-Dist: protobuf (==3.20.3)
12
- Requires-Dist: msal (>=1.24.0)
13
- Requires-Dist: joblib (==1.2.0)
14
- Requires-Dist: requests (==2.28.2)
15
- Requires-Dist: setuptools (==67.6.0)
16
- Requires-Dist: plotly (==5.13.1)
17
- Provides-Extra: all
18
- Requires-Dist: pandas (==1.5.3) ; extra == 'all'
19
- Requires-Dist: numpy (==1.26.4) ; extra == 'all'
20
- Requires-Dist: dill (==0.3.6) ; extra == 'all'
21
- Requires-Dist: protobuf (==3.20.3) ; extra == 'all'
22
- Requires-Dist: msal (>=1.24.0) ; extra == 'all'
23
- Requires-Dist: joblib (==1.2.0) ; extra == 'all'
24
- Requires-Dist: requests (==2.28.2) ; extra == 'all'
25
- Requires-Dist: setuptools (==67.6.0) ; extra == 'all'
26
- Requires-Dist: plotly (==5.13.1) ; extra == 'all'
27
- Requires-Dist: matplotlib (==3.7.1) ; extra == 'all'
28
- Requires-Dist: tensorflow-probability (==0.15.0) ; extra == 'all'
29
- Requires-Dist: scikit-learn (==1.2.2) ; extra == 'all'
30
- Requires-Dist: adtk (==0.6.2) ; extra == 'all'
31
- Requires-Dist: scipy (==1.10.1) ; extra == 'all'
32
- Requires-Dist: xgboost (==1.7.4) ; extra == 'all'
33
- Requires-Dist: u8darts (==0.25.0) ; extra == 'all'
34
- Requires-Dist: optuna (==3.3.0) ; extra == 'all'
35
- Requires-Dist: explainerdashboard (==0.4.2.1) ; extra == 'all'
36
- Requires-Dist: ipywidgets (==8.0.4) ; extra == 'all'
37
- Requires-Dist: kaleido (==0.2.1) ; extra == 'all'
38
- Requires-Dist: pytest (==7.2.2) ; extra == 'all'
39
- Requires-Dist: pytest-cov (==4.0.0) ; extra == 'all'
40
- Requires-Dist: shapely (==2.0.1) ; extra == 'all'
41
- Requires-Dist: pyodbc (==4.0.35) ; extra == 'all'
42
- Requires-Dist: tensorflow (==2.15.0) ; (sys_platform != "darwin" or platform_machine != "arm64") and extra == 'all'
43
- Requires-Dist: keras (==2.15.0) ; (sys_platform != "darwin" or platform_machine != "arm64") and extra == 'all'
44
- Requires-Dist: tensorflow-macos (==2.15.0) ; (sys_platform == "darwin" and platform_machine == "arm64") and extra == 'all'
45
- Requires-Dist: keras (==2.15.0) ; (sys_platform == "darwin" and platform_machine == "arm64") and extra == 'all'
46
-