iqm-station-control-client 2.20__py3-none-any.whl → 3.0__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.
- iqm/station_control/client/serializers/sweep_serializers.py +3 -3
- iqm/station_control/client/station_control.py +3 -34
- iqm/station_control/interface/models/observation.py +2 -1
- iqm/station_control/interface/models/sweep.py +0 -21
- iqm/station_control/interface/pydantic_base.py +1 -46
- {iqm_station_control_client-2.20.dist-info → iqm_station_control_client-3.0.dist-info}/METADATA +3 -3
- {iqm_station_control_client-2.20.dist-info → iqm_station_control_client-3.0.dist-info}/RECORD +10 -10
- {iqm_station_control_client-2.20.dist-info → iqm_station_control_client-3.0.dist-info}/LICENSE.txt +0 -0
- {iqm_station_control_client-2.20.dist-info → iqm_station_control_client-3.0.dist-info}/WHEEL +0 -0
- {iqm_station_control_client-2.20.dist-info → iqm_station_control_client-3.0.dist-info}/top_level.txt +0 -0
|
@@ -22,8 +22,8 @@ from iqm.data_definitions.station_control.v1.sweep_request_pb2 import SweepReque
|
|
|
22
22
|
from iqm.data_definitions.station_control.v2.task_service_pb2 import SweepResultsResponse as SweepResultsResponseProto
|
|
23
23
|
|
|
24
24
|
from exa.common.api import proto_serialization
|
|
25
|
-
from exa.common.api.model.setting_node_model import SettingNodeModel
|
|
26
25
|
from exa.common.api.proto_serialization import array
|
|
26
|
+
from exa.common.data.setting_node import SettingNode
|
|
27
27
|
from exa.common.sweep.database_serialization import decode_and_validate_sweeps, encode_nd_sweeps
|
|
28
28
|
from iqm.station_control.client.serializers.datetime_serializers import deserialize_datetime, serialize_datetime
|
|
29
29
|
from iqm.station_control.client.serializers.playlist_serializers import pack_playlist, unpack_playlist
|
|
@@ -67,7 +67,7 @@ def serialize_sweep_data(sweep_data: SweepData) -> dict:
|
|
|
67
67
|
return {
|
|
68
68
|
"sweep_id": str(sweep_data.sweep_id),
|
|
69
69
|
"dut_label": sweep_data.dut_label,
|
|
70
|
-
"settings":
|
|
70
|
+
"settings": sweep_data.settings.model_dump_json() if sweep_data.settings else None,
|
|
71
71
|
"sweeps": encode_nd_sweeps(sweep_data.sweeps),
|
|
72
72
|
"return_parameters": sweep_data.return_parameters,
|
|
73
73
|
"created_timestamp": serialize_datetime(sweep_data.created_timestamp),
|
|
@@ -83,7 +83,7 @@ def deserialize_sweep_data(data: dict) -> SweepData:
|
|
|
83
83
|
return SweepData(
|
|
84
84
|
sweep_id=uuid.UUID(data["sweep_id"]),
|
|
85
85
|
dut_label=data["dut_label"],
|
|
86
|
-
settings=
|
|
86
|
+
settings=SettingNode(**json.loads(data["settings"])),
|
|
87
87
|
sweeps=decode_and_validate_sweeps(data["sweeps"]),
|
|
88
88
|
return_parameters=data["return_parameters"],
|
|
89
89
|
created_timestamp=deserialize_datetime(data["created_timestamp"]),
|
|
@@ -30,7 +30,6 @@ import requests
|
|
|
30
30
|
|
|
31
31
|
from exa.common.data.setting_node import SettingNode
|
|
32
32
|
from exa.common.errors.exa_error import RequestError
|
|
33
|
-
from exa.common.qcm_data.chad_model import CHAD
|
|
34
33
|
from exa.common.qcm_data.qcm_data_client import QCMDataClient
|
|
35
34
|
from iqm.station_control.client.list_models import (
|
|
36
35
|
DutFieldDataList,
|
|
@@ -110,7 +109,7 @@ class StationControlClient:
|
|
|
110
109
|
- range: Range test (inclusive).
|
|
111
110
|
For example, ``created_timestamp__range=(datetime(2023, 10, 12), datetime(2024, 10, 14))``
|
|
112
111
|
- in: In a given iterable; often a list, tuple, or queryset.
|
|
113
|
-
For example, ``dut_field__in=["QB1.frequency", "QB2.
|
|
112
|
+
For example, ``dut_field__in=["QB1.frequency", "gates.measure.constant.QB2.frequency"]``
|
|
114
113
|
- icontains: Case-insensitive containment test.
|
|
115
114
|
For example, ``origin_uri__icontains="local"``
|
|
116
115
|
- overlap: Returns objects where the data shares any results with the values passed.
|
|
@@ -169,7 +168,7 @@ class StationControlClient:
|
|
|
169
168
|
|
|
170
169
|
def get_settings(self) -> SettingNode:
|
|
171
170
|
"""Return a tree representation of the default settings as defined in the configuration file."""
|
|
172
|
-
return self._get_cached_settings().
|
|
171
|
+
return self._get_cached_settings().model_copy()
|
|
173
172
|
|
|
174
173
|
@cache
|
|
175
174
|
def _get_cached_settings(self) -> SettingNode:
|
|
@@ -184,7 +183,7 @@ class StationControlClient:
|
|
|
184
183
|
except RequestError as err:
|
|
185
184
|
if str(err).find("An error occurred on the server with the error code 404") >= 0 and self._qcm_data_client:
|
|
186
185
|
return self._qcm_data_client.get_chip_design_record(dut_label)
|
|
187
|
-
|
|
186
|
+
raise err
|
|
188
187
|
return response.json()
|
|
189
188
|
|
|
190
189
|
@cache
|
|
@@ -203,36 +202,6 @@ class StationControlClient:
|
|
|
203
202
|
decoded_dict = unpack_channel_properties(response.content)
|
|
204
203
|
return decoded_dict
|
|
205
204
|
|
|
206
|
-
@cache
|
|
207
|
-
def get_chad(self, dut_label: str) -> CHAD:
|
|
208
|
-
"""DEPRECATED."""
|
|
209
|
-
logger.warning(
|
|
210
|
-
"StationControlClient.get_chad is deprecated, use StationControlClient.get_chip_design_record instead."
|
|
211
|
-
)
|
|
212
|
-
try:
|
|
213
|
-
response = self._send_request(requests.get, f"chads/{dut_label}")
|
|
214
|
-
return CHAD(**response.json())
|
|
215
|
-
except RequestError as err:
|
|
216
|
-
if str(err).find("An error occurred on the server with the error code 404") >= 0 and self._qcm_data_client:
|
|
217
|
-
chad_dict = self._qcm_data_client.get_chad(dut_label)
|
|
218
|
-
return CHAD(**chad_dict)
|
|
219
|
-
raise err
|
|
220
|
-
|
|
221
|
-
@cache
|
|
222
|
-
def get_qubit_design_properties(self, dut_label: str) -> dict:
|
|
223
|
-
"""DEPRECATED."""
|
|
224
|
-
logger.warning(
|
|
225
|
-
"StationControlClient.get_qubit_design_properties is deprecated, "
|
|
226
|
-
"use StationControlClient.get_chip_design_record instead."
|
|
227
|
-
)
|
|
228
|
-
try:
|
|
229
|
-
response = self._send_request(requests.get, f"qubit-design-properties/{dut_label}")
|
|
230
|
-
return response.json()
|
|
231
|
-
except RequestError as err:
|
|
232
|
-
if str(err).find("An error occurred on the server with the error code 404") >= 0 and self._qcm_data_client:
|
|
233
|
-
return self._qcm_data_client.get_qubit_design_properties(dut_label)
|
|
234
|
-
raise err
|
|
235
|
-
|
|
236
205
|
def sweep(
|
|
237
206
|
self,
|
|
238
207
|
sweep_definition: SweepDefinition,
|
|
@@ -19,7 +19,8 @@ import uuid
|
|
|
19
19
|
|
|
20
20
|
from pydantic import ConfigDict
|
|
21
21
|
|
|
22
|
-
from
|
|
22
|
+
from exa.common.data.value import Uncertainty, Value
|
|
23
|
+
from iqm.station_control.interface.pydantic_base import PydanticBase
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
class ObservationBase(PydanticBase):
|
|
@@ -17,7 +17,6 @@ from dataclasses import dataclass
|
|
|
17
17
|
from datetime import datetime
|
|
18
18
|
from enum import Enum
|
|
19
19
|
import uuid
|
|
20
|
-
import warnings
|
|
21
20
|
|
|
22
21
|
from iqm.models.playlist import Playlist
|
|
23
22
|
|
|
@@ -50,26 +49,6 @@ class SweepDefinition(SweepBase):
|
|
|
50
49
|
playlist: Playlist | None
|
|
51
50
|
"""A :class:`~iqm.models.playlist.Playlist` that should be uploaded to the controllers."""
|
|
52
51
|
|
|
53
|
-
def __init__(self, *args, playlist: Playlist | None = None, playlists: Playlist | None = None, **kwargs):
|
|
54
|
-
super().__init__(*args, **kwargs)
|
|
55
|
-
if playlists is not None:
|
|
56
|
-
warnings.warn("'playlists' attribute is deprecated, use 'playlist' instead.", DeprecationWarning)
|
|
57
|
-
self.playlist = playlists
|
|
58
|
-
elif playlist is not None:
|
|
59
|
-
self.playlist = playlist
|
|
60
|
-
else:
|
|
61
|
-
self.playlist = None
|
|
62
|
-
|
|
63
|
-
@property
|
|
64
|
-
def playlists(self):
|
|
65
|
-
"""Returns playlists for backwards compatibility."""
|
|
66
|
-
warnings.warn("'playlists' attribute is deprecated, use 'playlist' instead.", DeprecationWarning)
|
|
67
|
-
return self.playlist
|
|
68
|
-
|
|
69
|
-
@playlists.setter
|
|
70
|
-
def playlists(self, playlist):
|
|
71
|
-
self.playlist = playlist
|
|
72
|
-
|
|
73
52
|
|
|
74
53
|
class SweepStatus(Enum):
|
|
75
54
|
"""Status for sweeps."""
|
|
@@ -13,12 +13,7 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
"""Pydantic related models and types."""
|
|
15
15
|
|
|
16
|
-
import
|
|
17
|
-
from typing import Annotated, Any
|
|
18
|
-
|
|
19
|
-
import numpy as np
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, PlainSerializer, PlainValidator, WithJsonSchema
|
|
21
|
-
from pydantic_core import core_schema
|
|
16
|
+
from pydantic import BaseModel, ConfigDict
|
|
22
17
|
|
|
23
18
|
|
|
24
19
|
class PydanticBase(BaseModel):
|
|
@@ -33,43 +28,3 @@ class PydanticBase(BaseModel):
|
|
|
33
28
|
validate_default=True, # Validate default values during validation
|
|
34
29
|
ser_json_inf_nan="constants", # Will serialize Infinity and NaN values as Infinity and NaN.
|
|
35
30
|
)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def validate_value(value: Any) -> Any:
|
|
39
|
-
"""Validate (i.e. deserialize) JSON serializable value to Python type, to support complex and ndarray types."""
|
|
40
|
-
if isinstance(value, dict):
|
|
41
|
-
if "__complex__" in value:
|
|
42
|
-
value = complex(value["real"], value["imag"])
|
|
43
|
-
elif "__ndarray__" in value:
|
|
44
|
-
data = base64.b64decode(value["data"])
|
|
45
|
-
value = np.frombuffer(data, value["dtype"]).reshape(value["shape"])
|
|
46
|
-
return value
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def serialize_value(value: Any) -> Any:
|
|
50
|
-
"""Serialize value type to JSON serializable type, to support complex and ndarray types."""
|
|
51
|
-
if isinstance(value, complex):
|
|
52
|
-
value = {"__complex__": "true", "real": value.real, "imag": value.imag}
|
|
53
|
-
elif isinstance(value, np.ndarray):
|
|
54
|
-
# ensure array buffer is contiguous and in C order
|
|
55
|
-
value = np.require(value, requirements=["A", "C"])
|
|
56
|
-
data = base64.b64encode(value.data)
|
|
57
|
-
value = {"__ndarray__": "true", "data": data, "dtype": str(value.dtype), "shape": value.shape}
|
|
58
|
-
return value
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
# TODO: We might want to rename these to ObservationValue and ObservationUncertainty, respectively.
|
|
62
|
-
Value = Annotated[
|
|
63
|
-
bool | str | int | float | complex | np.ndarray,
|
|
64
|
-
PlainValidator(validate_value),
|
|
65
|
-
PlainSerializer(serialize_value),
|
|
66
|
-
WithJsonSchema(core_schema.any_schema()),
|
|
67
|
-
]
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
Uncertainty = Annotated[
|
|
71
|
-
int | float | complex | np.ndarray,
|
|
72
|
-
PlainValidator(validate_value),
|
|
73
|
-
PlainSerializer(serialize_value),
|
|
74
|
-
WithJsonSchema(core_schema.any_schema()),
|
|
75
|
-
]
|
{iqm_station_control_client-2.20.dist-info → iqm_station_control_client-3.0.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: iqm-station-control-client
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.0
|
|
4
4
|
Summary: Python client for communicating with Station Control Service
|
|
5
5
|
Author-email: IQM Finland Oy <info@meetiqm.com>
|
|
6
6
|
License: Apache License
|
|
@@ -213,11 +213,11 @@ Classifier: Intended Audience :: Science/Research
|
|
|
213
213
|
Requires-Python: >=3.11
|
|
214
214
|
Description-Content-Type: text/x-rst
|
|
215
215
|
License-File: LICENSE.txt
|
|
216
|
-
Requires-Dist: iqm-exa-common <26
|
|
216
|
+
Requires-Dist: iqm-exa-common <27,>=26
|
|
217
217
|
Requires-Dist: iqm-data-definitions <3.0,>=2.8
|
|
218
218
|
Requires-Dist: opentelemetry-exporter-otlp ==1.25.0
|
|
219
219
|
Requires-Dist: protobuf <5.0,>=4.25.3
|
|
220
|
-
Requires-Dist: pydantic <3.0,>=2.
|
|
220
|
+
Requires-Dist: pydantic <3.0,>=2.10.4
|
|
221
221
|
Requires-Dist: PyYAML ==6.0
|
|
222
222
|
Requires-Dist: requests ==2.32.3
|
|
223
223
|
Requires-Dist: tqdm >=4.59.0
|
{iqm_station_control_client-2.20.dist-info → iqm_station_control_client-3.0.dist-info}/RECORD
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
iqm/station_control/client/__init__.py,sha256=BmBIBdZa10r-IWCFzZ1-0DG6GQKPIXqGXltfXop4ZeQ,942
|
|
2
2
|
iqm/station_control/client/list_models.py,sha256=SjD0DbCrM9z1SSuGoQS83lyJmDLuMOatpJUoW8itW9s,2335
|
|
3
|
-
iqm/station_control/client/station_control.py,sha256=
|
|
3
|
+
iqm/station_control/client/station_control.py,sha256=pvSGWObxTs61Iyiv7pcl9SDLvKijkaZZYzJC8VoGIgo,33584
|
|
4
4
|
iqm/station_control/client/utils.py,sha256=3VVLCXt6rcKNQc4HerlMxpxkRfTFMYCwOQHF2DS1OG8,1143
|
|
5
5
|
iqm/station_control/client/serializers/__init__.py,sha256=8os3EGOtNTRFaviZdGwDyMt9GUpM3ZP7icPKAxOg1qg,1438
|
|
6
6
|
iqm/station_control/client/serializers/channel_property_serializer.py,sha256=ChlX8B-blM5hjv3pUExHOd-vE3O_myPwILu36KZYYNU,7121
|
|
@@ -9,21 +9,21 @@ iqm/station_control/client/serializers/playlist_serializers.py,sha256=S8RuKdqeJx
|
|
|
9
9
|
iqm/station_control/client/serializers/run_serializers.py,sha256=4zH0I5EvvaP7wgLMprXXWa36nAPO4Lv0fPkCrDC_v-g,6698
|
|
10
10
|
iqm/station_control/client/serializers/setting_node_serializer.py,sha256=m4Sbm8Qr3GiSNiE-Jh8gFEgfscfN1xxELb0vCa9cK70,1197
|
|
11
11
|
iqm/station_control/client/serializers/struct_serializer.py,sha256=QztBsbRlRG_UrtpQLE3bi0WKEVn48kVB91H1g26PvqQ,3270
|
|
12
|
-
iqm/station_control/client/serializers/sweep_serializers.py,sha256=
|
|
12
|
+
iqm/station_control/client/serializers/sweep_serializers.py,sha256=2COfE3ewusjeIp7q3sQWEpc9nzUrfjMNTeemihtpzKA,5725
|
|
13
13
|
iqm/station_control/client/serializers/task_serializers.py,sha256=mUi6IeNBUQnWy5U65C2fL597lcee71YAo9o8VM-aCnE,2712
|
|
14
14
|
iqm/station_control/interface/__init__.py,sha256=MIQla-cBKPbZqBkp-LNyPfjiV0gzf-IFEwrMMhsnKlg,785
|
|
15
15
|
iqm/station_control/interface/list_with_meta.py,sha256=GAXIDEXKeua6-2FoQ_O1tkhx-d8pBMGHaIkdvgg-cag,1185
|
|
16
|
-
iqm/station_control/interface/pydantic_base.py,sha256=
|
|
16
|
+
iqm/station_control/interface/pydantic_base.py,sha256=MVzcsH7wG1DON-qTw6KLpUDay7_b_9CDQgymVzg9HwI,1303
|
|
17
17
|
iqm/station_control/interface/models/__init__.py,sha256=PbENb1YhX2OLGTiJNvj70e5Acj7f8jMP3hp5ncH5U-0,1527
|
|
18
18
|
iqm/station_control/interface/models/dut.py,sha256=dd1SpcsBe4P057jvcPqv39SjzekewwP07hThFe5ulNA,1216
|
|
19
|
-
iqm/station_control/interface/models/observation.py,sha256=
|
|
19
|
+
iqm/station_control/interface/models/observation.py,sha256=Jce4lIsUtHRIFT3nr-cbKvh3dbR2Y_yM5x0yyvUdjF8,3261
|
|
20
20
|
iqm/station_control/interface/models/observation_set.py,sha256=Ko2o3-9I38NfjNF2IQPcwfbwpkTQ3PIU7fUiSaDleX8,3031
|
|
21
21
|
iqm/station_control/interface/models/run.py,sha256=m-iE3QMPQUOF7bsw8JCAM1Bd6bDVhAgxrtc_AC7rCkc,4097
|
|
22
22
|
iqm/station_control/interface/models/sequence.py,sha256=uOqMwF1x-vW6UHs2WnPD3PsuSgV3a8OTAsgn_4UENLw,2723
|
|
23
|
-
iqm/station_control/interface/models/sweep.py,sha256=
|
|
23
|
+
iqm/station_control/interface/models/sweep.py,sha256=6SQ4Ty4_Rm1KTeR7YfrLmwyD-AnNE495LMxYu8dM4Ko,2947
|
|
24
24
|
iqm/station_control/interface/models/type_aliases.py,sha256=3LB9viZVi8osavY5kKF8TH1crayG7-MLjgBqXDCqL2s,1018
|
|
25
|
-
iqm_station_control_client-
|
|
26
|
-
iqm_station_control_client-
|
|
27
|
-
iqm_station_control_client-
|
|
28
|
-
iqm_station_control_client-
|
|
29
|
-
iqm_station_control_client-
|
|
25
|
+
iqm_station_control_client-3.0.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
|
|
26
|
+
iqm_station_control_client-3.0.dist-info/METADATA,sha256=XRYYj8Sfri864rILkOZ-XzrZz6syXgiZheJk1wGVCTA,13971
|
|
27
|
+
iqm_station_control_client-3.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
|
|
28
|
+
iqm_station_control_client-3.0.dist-info/top_level.txt,sha256=NB4XRfyDS6_wG9gMsyX-9LTU7kWnTQxNvkbzIxGv3-c,4
|
|
29
|
+
iqm_station_control_client-3.0.dist-info/RECORD,,
|
{iqm_station_control_client-2.20.dist-info → iqm_station_control_client-3.0.dist-info}/LICENSE.txt
RENAMED
|
File without changes
|
{iqm_station_control_client-2.20.dist-info → iqm_station_control_client-3.0.dist-info}/WHEEL
RENAMED
|
File without changes
|
{iqm_station_control_client-2.20.dist-info → iqm_station_control_client-3.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|