wizata-dsapi 1.3.26__tar.gz → 1.3.28__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.
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/PKG-INFO +1 -1
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/mlmodel.py +51 -10
- wizata_dsapi-1.3.28/wizata_dsapi/version.py +1 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi.egg-info/PKG-INFO +1 -1
- wizata_dsapi-1.3.26/wizata_dsapi/version.py +0 -1
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/LICENSE.txt +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/README.rst +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/setup.cfg +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/setup.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/__init__.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/api_config.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/api_dto.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/api_interface.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/bucket.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/business_label.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/context.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/dataframe_toolkit.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/datapoint.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/datastore.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/ds_dataframe.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/dsapi_json_encoder.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/evaluation.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/execution.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/experiment.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/group_system.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/ilogger.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/insight.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/model_toolkit.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/models/__init__.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/models/common.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/paged_query_result.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/pipeline.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/pipeline_image.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/plot.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/plots/__init__.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/plots/common.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/request.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/script.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/scripts/__init__.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/scripts/common.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/solution_component.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/streamlit_utils.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/template.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/trigger.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/twin.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/twinregistration.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/wizard_function.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/wizard_request.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/wizata_dsapi_client.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi/words.py +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi.egg-info/SOURCES.txt +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi.egg-info/dependency_links.txt +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi.egg-info/requires.txt +0 -0
- {wizata_dsapi-1.3.26 → wizata_dsapi-1.3.28}/wizata_dsapi.egg-info/top_level.txt +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from typing import List, Iterator, Union
|
|
2
|
+
import os
|
|
2
3
|
from .api_dto import ApiDto
|
|
3
4
|
|
|
4
5
|
|
|
@@ -47,6 +48,33 @@ class ModelInfo:
|
|
|
47
48
|
self.has_target_feat = False
|
|
48
49
|
self.label_counts = 0
|
|
49
50
|
|
|
51
|
+
@classmethod
|
|
52
|
+
def split_identifier(cls, identifier: str):
|
|
53
|
+
"""
|
|
54
|
+
split the identifier into four parts
|
|
55
|
+
:param identifier: identifier.
|
|
56
|
+
:return: key, twin, property, alias
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
# extract alias
|
|
60
|
+
if "@" in identifier:
|
|
61
|
+
split_identifier_for_alias = identifier.split("@")
|
|
62
|
+
identifier = split_identifier_for_alias[0]
|
|
63
|
+
alias = split_identifier_for_alias[1]
|
|
64
|
+
else:
|
|
65
|
+
alias = None
|
|
66
|
+
|
|
67
|
+
# extract key, twin, property
|
|
68
|
+
identifiers = identifier.split('.')
|
|
69
|
+
key = identifiers[0]
|
|
70
|
+
twin_hardware_id = None
|
|
71
|
+
if len(identifiers) > 1:
|
|
72
|
+
twin_hardware_id = identifiers[1]
|
|
73
|
+
property_value = None
|
|
74
|
+
if len(identifiers) > 2:
|
|
75
|
+
property_value = identifiers[2]
|
|
76
|
+
|
|
77
|
+
return key, twin_hardware_id, property_value, alias
|
|
50
78
|
|
|
51
79
|
def identifier(self, include_alias: bool = False) -> str:
|
|
52
80
|
"""
|
|
@@ -69,6 +97,18 @@ class ModelInfo:
|
|
|
69
97
|
|
|
70
98
|
return identifier
|
|
71
99
|
|
|
100
|
+
def add_file_path(self, file_path: str):
|
|
101
|
+
"""
|
|
102
|
+
add a path to list of known path.
|
|
103
|
+
detect depending on file type further actions.
|
|
104
|
+
:param file_path: file_path
|
|
105
|
+
:return: None
|
|
106
|
+
"""
|
|
107
|
+
path, extension = os.path.splitext(file_path)
|
|
108
|
+
if path == "trained_model":
|
|
109
|
+
self.file_format = extension.lstrip('.')
|
|
110
|
+
self.files.append(file_path)
|
|
111
|
+
|
|
72
112
|
def to_json(self):
|
|
73
113
|
"""
|
|
74
114
|
convert this entity in a dict that can be json serializable
|
|
@@ -133,31 +173,32 @@ class ModelList:
|
|
|
133
173
|
def __len__(self) -> int:
|
|
134
174
|
return len(self.models)
|
|
135
175
|
|
|
136
|
-
def exists(self,
|
|
176
|
+
def exists(self, model: ModelInfo) -> bool:
|
|
137
177
|
"""
|
|
138
178
|
check if a model is within the model list.
|
|
139
|
-
:param
|
|
179
|
+
:param model: identifier to check.
|
|
140
180
|
:return: True if it exists.
|
|
141
181
|
"""
|
|
142
|
-
return any(
|
|
182
|
+
return any(model_in_list.identifier(include_alias=True) == model.identifier(include_alias=True) for model_in_list in self.models)
|
|
143
183
|
|
|
144
|
-
def __getitem__(self, key: Union[int,
|
|
184
|
+
def __getitem__(self, key: Union[int, ModelInfo]) -> ModelInfo:
|
|
145
185
|
"""
|
|
146
|
-
find a model within list based on key or
|
|
147
|
-
:param key:
|
|
186
|
+
find a model within list based on key or ModelInfo.
|
|
187
|
+
:param key: ModelInfo or index
|
|
148
188
|
:return: the model_info
|
|
149
189
|
"""
|
|
150
190
|
if isinstance(key, int):
|
|
151
191
|
return self.models[key]
|
|
152
192
|
|
|
153
|
-
elif isinstance(key,
|
|
193
|
+
elif isinstance(key, ModelInfo):
|
|
194
|
+
identifier = key.identifier(include_alias=True)
|
|
154
195
|
for model in self.models:
|
|
155
|
-
if model.identifier() ==
|
|
196
|
+
if model.identifier(include_alias=True) == identifier:
|
|
156
197
|
return model
|
|
157
|
-
raise KeyError(f"model with identifier '{
|
|
198
|
+
raise KeyError(f"model with identifier '{identifier}' not found within this ModelList.")
|
|
158
199
|
|
|
159
200
|
else:
|
|
160
|
-
raise TypeError("ModelList indices must be int or
|
|
201
|
+
raise TypeError("ModelList indices must be int or ModelInfo.")
|
|
161
202
|
|
|
162
203
|
def append(self, model: ModelInfo):
|
|
163
204
|
self.models.append(model)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.3.28"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.3.26"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|