iqm-station-control-client 9.1.0__py3-none-any.whl → 9.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.
@@ -96,7 +96,7 @@ class IqmServerClient(_StationControlClientBase):
96
96
  ):
97
97
  super().__init__(root_url, get_token_callback=get_token_callback, client_signature=client_signature)
98
98
  self._connection_params = parse_connection_params(root_url)
99
- self._cached_resources = {}
99
+ self._cached_resources: dict[str, Any] = {}
100
100
  self._latest_submitted_sweep = None
101
101
  self._channel = grpc_channel or create_channel(self._connection_params, self._get_token_callback)
102
102
  self._current_qc = resolve_current_qc(self._channel, self._connection_params.quantum_computer)
@@ -23,4 +23,4 @@ class Uuid(_message.Message):
23
23
  STR_FIELD_NUMBER: _ClassVar[int]
24
24
  raw: bytes
25
25
  str: str
26
- def __init__(self, raw: _Optional[bytes] = ..., str: _Optional[str] = ...) -> None: ...
26
+ def __init__(self, raw: _Optional[bytes] = ..., str: _Optional[str] = ...) -> None: ...# type: ignore[valid-type]
@@ -64,12 +64,12 @@ class ListModel(RootModel):
64
64
  )
65
65
 
66
66
 
67
- DutList: TypeAlias = ListModel[list[DutData]]
68
- DutFieldDataList: TypeAlias = ListModel[list[DutFieldData]]
69
- ObservationDataList: TypeAlias = ListModel[list[ObservationData]]
70
- ObservationDefinitionList: TypeAlias = ListModel[list[ObservationDefinition]]
71
- ObservationLiteList: TypeAlias = ListModel[list[ObservationLite]]
72
- ObservationUpdateList: TypeAlias = ListModel[list[ObservationUpdate]]
73
- ObservationSetDataList: TypeAlias = ListModel[list[ObservationSetData]]
74
- SequenceMetadataDataList: TypeAlias = ListModel[list[SequenceMetadataData]]
75
- RunLiteList: TypeAlias = ListModel[list[RunLite]]
67
+ DutList: TypeAlias = ListModel[list[DutData]] # type: ignore[type-arg]
68
+ DutFieldDataList: TypeAlias = ListModel[list[DutFieldData]] # type: ignore[type-arg]
69
+ ObservationDataList: TypeAlias = ListModel[list[ObservationData]] # type: ignore[type-arg]
70
+ ObservationDefinitionList: TypeAlias = ListModel[list[ObservationDefinition]] # type: ignore[type-arg]
71
+ ObservationLiteList: TypeAlias = ListModel[list[ObservationLite]] # type: ignore[type-arg]
72
+ ObservationUpdateList: TypeAlias = ListModel[list[ObservationUpdate]] # type: ignore[type-arg]
73
+ ObservationSetDataList: TypeAlias = ListModel[list[ObservationSetData]] # type: ignore[type-arg]
74
+ SequenceMetadataDataList: TypeAlias = ListModel[list[SequenceMetadataData]] # type: ignore[type-arg]
75
+ RunLiteList: TypeAlias = ListModel[list[RunLite]] # type: ignore[type-arg]
@@ -251,7 +251,7 @@ class StationControlClient(_StationControlClientBase):
251
251
  super().__init__(
252
252
  root_url,
253
253
  get_token_callback=get_token_callback,
254
- client_signature=client_signature,
254
+ client_signature=client_signature, # type: ignore[arg-type]
255
255
  enable_opentelemetry=os.environ.get("JAEGER_OPENTELEMETRY_COLLECTOR_ENDPOINT", None) is not None,
256
256
  )
257
257
  # TODO SW-1387: Remove this when using v1 API, not needed
@@ -602,7 +602,7 @@ class StationControlClient(_StationControlClientBase):
602
602
 
603
603
  @staticmethod
604
604
  def _clean_query_parameters(model: Any, **kwargs) -> dict[str, Any]:
605
- if issubclass(model, PydanticBase) and "invalid" in model.model_fields.keys() and "invalid" not in kwargs:
605
+ if issubclass(model, PydanticBase) and "invalid" in model.model_fields and "invalid" not in kwargs:
606
606
  # Get only valid items by default, "invalid=None" would return also invalid ones.
607
607
  # This default has to be set on the client side, server side uses default "None".
608
608
  kwargs["invalid"] = False
@@ -611,7 +611,7 @@ class StationControlClient(_StationControlClientBase):
611
611
  @staticmethod
612
612
  def _deserialize_response(
613
613
  response: requests.Response,
614
- model_class: type[TypePydanticBase] | type[ListModel[list[TypePydanticBase]]],
614
+ model_class: type[TypePydanticBase | ListModel[list[TypePydanticBase]]],
615
615
  *,
616
616
  list_with_meta: bool = False,
617
617
  ) -> TypePydanticBase | ListWithMeta[TypePydanticBase]:
@@ -13,9 +13,10 @@
13
13
  # limitations under the License.
14
14
  """Dynamic quantum architecture (DQA) related interface models."""
15
15
 
16
+ from typing import Any
16
17
  from uuid import UUID
17
18
 
18
- from pydantic import Field, StrictStr
19
+ from pydantic import Field, StrictStr, field_validator
19
20
 
20
21
  from iqm.station_control.interface.pydantic_base import PydanticBase
21
22
 
@@ -59,6 +60,26 @@ class GateInfo(PydanticBase):
59
60
  )
60
61
  """Mapping of loci to implementation names that override ``default_implementation`` for those loci."""
61
62
 
63
+ @field_validator("override_default_implementation", mode="before")
64
+ @classmethod
65
+ def override_default_implementation_validator(cls, value: Any) -> dict[Locus, str]:
66
+ """Converts locus keys to tuples if they are encoded as strings."""
67
+ new_value = {}
68
+ if isinstance(value, dict):
69
+ for k, v in value.items():
70
+ if isinstance(k, tuple):
71
+ new_value[k] = v
72
+ # When Pydantic serializes a dict with tuple keys into JSON, the keys are turned into
73
+ # comma-separated strings (because JSON only supports string keys). Here we convert
74
+ # them back into tuples.
75
+ elif isinstance(k, str):
76
+ new_k = tuple(k.split(","))
77
+ new_value[new_k] = v
78
+ else:
79
+ raise ValueError("'override_default_implementation' keys must be strings or tuples.")
80
+ return new_value
81
+ raise ValueError("'override_default_implementation' must be a dict.")
82
+
62
83
 
63
84
  class DynamicQuantumArchitecture(PydanticBase):
64
85
  """The dynamic quantum architecture (DQA).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-station-control-client
3
- Version: 9.1.0
3
+ Version: 9.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
@@ -1,11 +1,11 @@
1
1
  iqm/station_control/client/__init__.py,sha256=1ND-AkIE9xLGIscH3WN44eyll9nlFhXeyCm-8EDFGQ4,942
2
- iqm/station_control/client/list_models.py,sha256=xnGk7Yzy-9bGBv_6eUzyai5hNJmG9ACUyu02ifSeSTE,2467
3
- iqm/station_control/client/station_control.py,sha256=4xUiI5Rw---TQDTWhN5FJb-nqhq6PE8q6DGSPfaH6l4,28154
2
+ iqm/station_control/client/list_models.py,sha256=7JJyn5jCBOvMBJWdsVsPRLhtChMxqLa6O9hElpeXEt8,2701
3
+ iqm/station_control/client/station_control.py,sha256=S-0YdGLKla0v98ntABbij7sXXxP-CwkynbzqQRf21s0,28167
4
4
  iqm/station_control/client/utils.py,sha256=-6K4KgOgA4iyUCqX-w26JvFxlwlGBehGj4tIWCEbn74,3360
5
5
  iqm/station_control/client/iqm_server/__init__.py,sha256=nLsRHN1rnOKXwuzaq_liUpAYV3sis5jkyHccSdacV7U,624
6
6
  iqm/station_control/client/iqm_server/error.py,sha256=a8l7UTnzfbD8KDHP-uOve77S6LR1ai9uM_J_xHbLs0Y,1175
7
7
  iqm/station_control/client/iqm_server/grpc_utils.py,sha256=67-uxYnNQ9NkC6t8V1_e9XFuIYv47K1I4A39MfHncVM,5825
8
- iqm/station_control/client/iqm_server/iqm_server_client.py,sha256=Ey478VqH6vZm7oVoBn7Ht6PzZHDJg0y6Smiqo9W1mdU,19601
8
+ iqm/station_control/client/iqm_server/iqm_server_client.py,sha256=6kyk-cqyDX1Ihu0h3LRevVBADrNMOeBpH8sIyT0zT3A,19617
9
9
  iqm/station_control/client/iqm_server/proto/__init__.py,sha256=mOJQ_H-NEyJMffRaDSSZeXrScHaHaHEXULv-O_OJA3A,1345
10
10
  iqm/station_control/client/iqm_server/proto/calibration_pb2.py,sha256=gum0DGmqxhbfaar8SqahmSif1pB6hgo0pVcnoi3VMUo,3017
11
11
  iqm/station_control/client/iqm_server/proto/calibration_pb2.pyi,sha256=4lTHY_GhrsLIHqoGDkNLYu56QHzX_iHEbLaYq-HR1m8,2016
@@ -20,7 +20,7 @@ iqm/station_control/client/iqm_server/proto/qc_pb2.py,sha256=-ika0EK0l_I9V5-kcG2
20
20
  iqm/station_control/client/iqm_server/proto/qc_pb2.pyi,sha256=s4P3k2wA1XG1wRF_y9BQD7VQgDONQnhOzxItih8_d0I,2491
21
21
  iqm/station_control/client/iqm_server/proto/qc_pb2_grpc.py,sha256=6l6OECi0td_Ld7kd1MIrGjQmvs1F6Sd-vqeCfYeAS94,6958
22
22
  iqm/station_control/client/iqm_server/proto/uuid_pb2.py,sha256=H1O7qvtRg2zXqOVfWCjZH-2WjXdzyNjbSv2g0fKnfV0,1616
23
- iqm/station_control/client/iqm_server/proto/uuid_pb2.pyi,sha256=9LXcqNoQS1iapCsoMIZchKPP6-5jcbJqGLne9D4Fu5w,1029
23
+ iqm/station_control/client/iqm_server/proto/uuid_pb2.pyi,sha256=C78m8tpY-sB9VbneOCpSCzrgjqFFu4a1eKBngQB0GuA,1055
24
24
  iqm/station_control/client/iqm_server/proto/uuid_pb2_grpc.py,sha256=SF40l84__r-OGGNYBru5ik9gih-XqeTq2iwM5gMN5Qc,726
25
25
  iqm/station_control/client/iqm_server/testing/__init__.py,sha256=wCNfJHIR_bqG3ZBlgm55v90Rih7VCpfctoIMfwRMgjk,567
26
26
  iqm/station_control/client/iqm_server/testing/iqm_server_mock.py,sha256=X_Chi8TKx95PiuhFfGnRu9LxeIpnKKynW_8tXwxFQD8,3340
@@ -39,7 +39,7 @@ iqm/station_control/interface/pydantic_base.py,sha256=pQCa-8SRgBKMSwG-KyXA1HcIxE
39
39
  iqm/station_control/interface/station_control.py,sha256=Uh9bDEZjc9M5KOYsGjPMYVhnYsfVQfjT05sUjUSoDXA,20303
40
40
  iqm/station_control/interface/models/__init__.py,sha256=Kg-XRLuU7G4Zjtu8LhYD-v3zkCYHzLFaNvC_nukezlQ,1968
41
41
  iqm/station_control/interface/models/dut.py,sha256=Hc_0XllXeIPGWhHsY7PC_jMpi7swpqo3jQQEQVnF3AM,1216
42
- iqm/station_control/interface/models/dynamic_quantum_architecture.py,sha256=5W8e5oRNxvXm2nI36NipDrErg2vHdpC8zzpeGyqSNDQ,3621
42
+ iqm/station_control/interface/models/dynamic_quantum_architecture.py,sha256=3YlI9e1XxdbkBzlOdxmzYTccJ8AJRnRSIp-JoBf8Yyw,4698
43
43
  iqm/station_control/interface/models/jobs.py,sha256=4CVVGMsUOm_UO4w7UH-Shq7cbZe_5MkhGDpoBwHoHkc,5105
44
44
  iqm/station_control/interface/models/monitor.py,sha256=ItlgxtBup1hHg64uKeMKiFE7MaRRqSYdVRttsFD_XeU,1352
45
45
  iqm/station_control/interface/models/observation.py,sha256=FwhlI2xXZ_2-PA-LcDvscHuTbfdTWhw67zSNa9Buuvg,3261
@@ -49,8 +49,8 @@ iqm/station_control/interface/models/sequence.py,sha256=boWlMfP3woVgVObW3OaNbxsU
49
49
  iqm/station_control/interface/models/static_quantum_architecture.py,sha256=gsfJKlYsfZVEK3dqEKXkBSIHiY14DGwNbhPJdNHMtNM,1435
50
50
  iqm/station_control/interface/models/sweep.py,sha256=HFoFIrKhlYmHIBfGltY2O9_J28OvkkZILRbDHuqR0wc,2509
51
51
  iqm/station_control/interface/models/type_aliases.py,sha256=gEYJ8zOpV1m0NVyYUbAL43psp9Lxw_0t68mYlI65Sds,1262
52
- iqm_station_control_client-9.1.0.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
53
- iqm_station_control_client-9.1.0.dist-info/METADATA,sha256=dMBDpRAswdP4cKl7dZd81DCW4cQRKRtXyIeIoHa-9HM,14010
54
- iqm_station_control_client-9.1.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
55
- iqm_station_control_client-9.1.0.dist-info/top_level.txt,sha256=NB4XRfyDS6_wG9gMsyX-9LTU7kWnTQxNvkbzIxGv3-c,4
56
- iqm_station_control_client-9.1.0.dist-info/RECORD,,
52
+ iqm_station_control_client-9.3.0.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
53
+ iqm_station_control_client-9.3.0.dist-info/METADATA,sha256=Fsx6N7-afceIjDh8Fxzz7uZW7TDgcFIQr8__en45OlU,14010
54
+ iqm_station_control_client-9.3.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
55
+ iqm_station_control_client-9.3.0.dist-info/top_level.txt,sha256=NB4XRfyDS6_wG9gMsyX-9LTU7kWnTQxNvkbzIxGv3-c,4
56
+ iqm_station_control_client-9.3.0.dist-info/RECORD,,