wizata-dsapi 1.2.2__tar.gz → 1.2.4__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.2.2 → wizata_dsapi-1.2.4}/PKG-INFO +1 -1
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/__init__.py +1 -1
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/request.py +91 -0
- wizata_dsapi-1.2.4/wizata_dsapi/version.py +1 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi.egg-info/PKG-INFO +1 -1
- wizata_dsapi-1.2.2/wizata_dsapi/version.py +0 -1
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/LICENSE.txt +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/README.rst +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/setup.cfg +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/setup.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/api_config.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/api_dto.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/api_interface.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/bucket.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/business_label.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/context.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/dataframe_toolkit.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/datapoint.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/datastore.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/ds_dataframe.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/dsapi_json_encoder.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/evaluation.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/execution.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/experiment.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/group_system.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/ilogger.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/insight.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/mlmodel.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/model_toolkit.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/models/__init__.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/models/common.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/paged_query_result.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/pipeline.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/pipeline_image.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/plot.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/plots/__init__.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/plots/common.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/script.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/scripts/__init__.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/scripts/common.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/solution_component.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/streamlit_utils.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/template.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/trigger.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/twin.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/twinregistration.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/wizard_function.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/wizard_request.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/wizata_dsapi_client.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi/words.py +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi.egg-info/SOURCES.txt +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi.egg-info/dependency_links.txt +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi.egg-info/requires.txt +0 -0
- {wizata_dsapi-1.2.2 → wizata_dsapi-1.2.4}/wizata_dsapi.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ from .api_dto import ApiDto, VarType
|
|
|
4
4
|
from .paged_query_result import PagedQueryResult
|
|
5
5
|
from .plot import Plot
|
|
6
6
|
from .mlmodel import MLModel, MLModelConfig
|
|
7
|
-
from .request import Request, filter_map
|
|
7
|
+
from .request import Request, filter_map, RequestGroup, RequestGroupMap
|
|
8
8
|
from .execution import Execution, ExecutionStatus, ExecutionStepLog, AbortedException
|
|
9
9
|
from .experiment import Experiment
|
|
10
10
|
from .ds_dataframe import DSDataFrame
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import uuid
|
|
2
2
|
from datetime import datetime, timedelta, timezone
|
|
3
|
+
|
|
4
|
+
from reactivex.operators import group_by
|
|
5
|
+
|
|
3
6
|
from .dataframe_toolkit import generate_epoch
|
|
4
7
|
from .api_dto import ApiDto
|
|
5
8
|
|
|
@@ -13,6 +16,77 @@ filter_map = {
|
|
|
13
16
|
}
|
|
14
17
|
|
|
15
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
|
+
class RequestGroup:
|
|
38
|
+
"""
|
|
39
|
+
Define a group statement within a structured query.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
def __init__(self,
|
|
43
|
+
system_id,
|
|
44
|
+
events: list = None,
|
|
45
|
+
group_by: str = "id",
|
|
46
|
+
start_delay: int = 0,
|
|
47
|
+
end_delay: int = 0,
|
|
48
|
+
maps: list = None):
|
|
49
|
+
self.system_id = system_id
|
|
50
|
+
self.group_by = group_by
|
|
51
|
+
self.events = events
|
|
52
|
+
self.maps = maps
|
|
53
|
+
self.start_delay = start_delay
|
|
54
|
+
self.end_delay = end_delay
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_dict(cls, my_dict):
|
|
58
|
+
if my_dict is None or not isinstance(my_dict, dict):
|
|
59
|
+
raise ValueError(f"illegal group {my_dict}")
|
|
60
|
+
|
|
61
|
+
if "system_id" not in my_dict or my_dict["system_id"] is None:
|
|
62
|
+
if not isinstance(["system_id"], str) and not isinstance(my_dict["system_id"], int):
|
|
63
|
+
raise ValueError(f"please specify system_id in {my_dict}")
|
|
64
|
+
|
|
65
|
+
group = RequestGroup(
|
|
66
|
+
system_id=["system_id"]
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
# set group_by
|
|
70
|
+
if "group_by" in my_dict:
|
|
71
|
+
if my_dict["group_by"] not in ["id", "type"]:
|
|
72
|
+
raise ValueError(f"illegal group {my_dict['group_by']}")
|
|
73
|
+
group.group_by = my_dict["group_by"]
|
|
74
|
+
|
|
75
|
+
# one of the two is accepted to set events
|
|
76
|
+
if "event_ids" in my_dict:
|
|
77
|
+
group.events = my_dict["event_ids"]
|
|
78
|
+
if "events" in my_dict:
|
|
79
|
+
group.events = my_dict["events"]
|
|
80
|
+
|
|
81
|
+
if "start_delay" in my_dict:
|
|
82
|
+
group.start_delay = int(my_dict["start_delay"])
|
|
83
|
+
|
|
84
|
+
if "end_delay" in my_dict:
|
|
85
|
+
group.end_delay = int(my_dict["end_delay"])
|
|
86
|
+
|
|
87
|
+
return group
|
|
88
|
+
|
|
89
|
+
|
|
16
90
|
class Request(ApiDto):
|
|
17
91
|
"""
|
|
18
92
|
request defines how to fetch data from time-series database.
|
|
@@ -117,6 +191,23 @@ class Request(ApiDto):
|
|
|
117
191
|
else:
|
|
118
192
|
raise TypeError(f'field must be None, str or a list of str')
|
|
119
193
|
|
|
194
|
+
@property
|
|
195
|
+
def groups(self) -> list[RequestGroup]:
|
|
196
|
+
"""
|
|
197
|
+
return formatted groups list based on group
|
|
198
|
+
:return:
|
|
199
|
+
"""
|
|
200
|
+
if self.group is not None and self.group != {}:
|
|
201
|
+
if not isinstance(self.group, list):
|
|
202
|
+
return [RequestGroup.from_dict(self.group)]
|
|
203
|
+
else:
|
|
204
|
+
groups = []
|
|
205
|
+
for group in self.group:
|
|
206
|
+
groups.append(RequestGroup.from_dict(group))
|
|
207
|
+
return groups
|
|
208
|
+
else:
|
|
209
|
+
return []
|
|
210
|
+
|
|
120
211
|
def get_template_id(self):
|
|
121
212
|
"""
|
|
122
213
|
extract template id from request if present.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.2.4"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.2.2"
|
|
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
|