iqm-exa-common 26.8__py3-none-any.whl → 26.10__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.
@@ -14,7 +14,7 @@
14
14
 
15
15
  """Convert native Python types and numpy arrays to protos and back."""
16
16
 
17
- from typing import Optional, Sequence, Union
17
+ from collections.abc import Sequence
18
18
 
19
19
  import iqm.data_definitions.common.v1.data_types_pb2 as dpb
20
20
  import numpy as np
@@ -22,7 +22,7 @@ import numpy as np
22
22
  from exa.common.api.proto_serialization import array, sequence
23
23
 
24
24
 
25
- def pack(value: Union[None, bool, str, int, float, complex, np.ndarray, Sequence]) -> dpb.Datum:
25
+ def pack(value: None | bool | str | int | float | complex | np.ndarray | Sequence) -> dpb.Datum:
26
26
  """Packs a string, numerical value, or an array thereof into protobuf format.
27
27
 
28
28
  Supported data types are:
@@ -66,7 +66,7 @@ def pack(value: Union[None, bool, str, int, float, complex, np.ndarray, Sequence
66
66
  raise TypeError(f"Encoding of type '{type(value)}' is not supported.")
67
67
 
68
68
 
69
- def unpack(source: dpb.Datum) -> Union[None, str, bool, int, float, complex, np.ndarray, list]:
69
+ def unpack(source: dpb.Datum) -> None | str | bool | int | float | complex | np.ndarray | list:
70
70
  """Unpacks a protobuf into a native Python type or a numpy array. Reverse operation of :func:`.pack`.
71
71
 
72
72
  Args:
@@ -99,7 +99,7 @@ def unpack(source: dpb.Datum) -> Union[None, str, bool, int, float, complex, np.
99
99
  raise TypeError(f"Unrecognized datatype field {field_name}")
100
100
 
101
101
 
102
- def serialize(value: Union[None, bool, str, int, float, complex, np.ndarray, Sequence]) -> bytes:
102
+ def serialize(value: None | bool | str | int | float | complex | np.ndarray | Sequence) -> bytes:
103
103
  """Serialize a piece of data into a bitstring.
104
104
 
105
105
  Args:
@@ -112,7 +112,7 @@ def serialize(value: Union[None, bool, str, int, float, complex, np.ndarray, Seq
112
112
  return pack(value).SerializeToString()
113
113
 
114
114
 
115
- def deserialize(source: bytes) -> Union[None, str, bool, int, float, complex, np.ndarray, list]:
115
+ def deserialize(source: bytes) -> None | str | bool | int | float | complex | np.ndarray | list:
116
116
  """Deserialize a bitstring into a native Python type or a numpy array. Reverse operation of :func:`.serialize`.
117
117
 
118
118
  Args:
@@ -127,7 +127,7 @@ def deserialize(source: bytes) -> Union[None, str, bool, int, float, complex, np
127
127
  return unpack(proto)
128
128
 
129
129
 
130
- def _pack_complex128(value: Union[np.complex128, complex], target: Optional[dpb.Complex128] = None) -> dpb.Complex128:
130
+ def _pack_complex128(value: np.complex128 | complex, target: dpb.Complex128 | None = None) -> dpb.Complex128:
131
131
  """Packs a numpy complex128 to the respective protobuf type."""
132
132
  target = target or dpb.Complex128()
133
133
  target.real = value.real
@@ -14,7 +14,7 @@
14
14
 
15
15
  """Convert Python Sequences to protos and back."""
16
16
 
17
- from typing import Sequence
17
+ from collections.abc import Sequence
18
18
 
19
19
  import iqm.data_definitions.common.v1.data_types_pb2 as dpb
20
20
  import numpy as np
@@ -58,9 +58,10 @@ parameter.
58
58
  from __future__ import annotations
59
59
 
60
60
  import ast
61
+ from collections.abc import Hashable
61
62
  import copy
62
63
  from enum import IntEnum
63
- from typing import Any, Hashable, Self
64
+ from typing import Any, Self
64
65
  import warnings
65
66
 
66
67
  import numpy as np
@@ -205,13 +205,13 @@ flag is used.
205
205
 
206
206
  from __future__ import annotations
207
207
 
208
- from collections.abc import Generator, ItemsView, Iterator
208
+ from collections.abc import Generator, ItemsView, Iterable, Iterator
209
209
  from copy import copy
210
210
  from itertools import permutations
211
211
  import logging
212
212
  import numbers
213
213
  import pathlib
214
- from typing import Any, Iterable
214
+ from typing import Any
215
215
 
216
216
  import jinja2
217
217
  import numpy as np
@@ -12,7 +12,6 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- from typing import Optional
16
15
 
17
16
  import xarray as xr
18
17
 
@@ -20,7 +19,7 @@ import xarray as xr
20
19
  """
21
20
 
22
21
 
23
- def add_data_array(ds: xr.Dataset, da: xr.DataArray, name: Optional[str] = None) -> xr.Dataset:
22
+ def add_data_array(ds: xr.Dataset, da: xr.DataArray, name: str | None = None) -> xr.Dataset:
24
23
  """Add data array `da` to dataset `ds`.
25
24
 
26
25
  Unlike the default xarray command, preserves metadata of the dataset.
@@ -13,7 +13,8 @@
13
13
  # limitations under the License.
14
14
 
15
15
  import base64
16
- from typing import Any, Callable
16
+ from collections.abc import Callable
17
+ from typing import Any
17
18
 
18
19
  import numpy as np
19
20
 
@@ -17,7 +17,6 @@ from importlib.metadata import distribution
17
17
  import os
18
18
  import platform
19
19
  import subprocess
20
- from typing import Optional
21
20
 
22
21
  import pkg_resources
23
22
 
@@ -79,7 +78,7 @@ def get_all_software_versions(reload_module: bool = False) -> dict[str, str]:
79
78
  return software_versions
80
79
 
81
80
 
82
- def get_vcs_description(root_directory: str) -> Optional[str]:
81
+ def get_vcs_description(root_directory: str) -> str | None:
83
82
  """Get Version Control System (VCS) description for the caller's current working directory.
84
83
 
85
84
  The description is used to verify if a directory is installed under VCS and whether changes to the files have
@@ -12,9 +12,10 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ from collections.abc import Callable
15
16
  import logging
16
17
  import logging.config
17
- from typing import Any, Callable, Optional
18
+ from typing import Any
18
19
 
19
20
  BRIEF_DATEFMT = "%m-%d %H:%M:%S"
20
21
 
@@ -25,7 +26,7 @@ VERBOSE = "[{asctime};{levelname};{processName}({process});{threadName}({thread}
25
26
  class ExtraFormatter(logging.Formatter):
26
27
  """Helper formatter class to pass in arbitrary extra information to log messages."""
27
28
 
28
- def __init__(self, *args, extra_info_getter: Optional[Callable[[], str]] = None, **kwargs):
29
+ def __init__(self, *args, extra_info_getter: Callable[[], str] | None = None, **kwargs):
29
30
  self.extra_info_getter = extra_info_getter if extra_info_getter is not None else lambda: ""
30
31
  super().__init__(*args, **kwargs)
31
32
 
@@ -43,10 +44,10 @@ class InfoFilter(logging.Filter):
43
44
 
44
45
 
45
46
  def init_loggers(
46
- loggers: Optional[dict[str, Optional[str]]] = None,
47
+ loggers: dict[str, str | None] | None = None,
47
48
  default_level: str = "INFO",
48
49
  verbose: bool = False,
49
- extra_info_getter: Optional[Callable[[], str]] = None,
50
+ extra_info_getter: Callable[[], str] | None = None,
50
51
  ) -> None:
51
52
  """Set the log level of given logger names.
52
53
 
@@ -17,7 +17,6 @@
17
17
  from collections.abc import Collection
18
18
  from functools import cached_property
19
19
  import re
20
- from typing import Union
21
20
 
22
21
  from pydantic import Field, field_validator
23
22
 
@@ -167,7 +166,7 @@ class CHAD(ImmutableBaseModel):
167
166
 
168
167
  launchers = {launcher.name: launcher for launcher in self.components.launchers}
169
168
 
170
- component: Union[Qubit, Coupler]
169
+ component: Qubit | Coupler
171
170
  for component in [*self.components.qubits, *self.components.couplers]:
172
171
  component_type = "qubit" if isinstance(component, Qubit) else "coupler"
173
172
  if component.name in component_names:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-exa-common
3
- Version: 26.8
3
+ Version: 26.10
4
4
  Summary: Framework for control and measurement of superconducting qubits: common library
5
5
  Author-email: IQM Finland Oy <info@meetiqm.com>
6
6
  License: Apache License
@@ -3,9 +3,9 @@ exa/common/api/__init__.py,sha256=PAYujWNG8CtSQX_8U9gnubDh5cwGRhtOfLr0r0xGx3M,58
3
3
  exa/common/api/proto_serialization/__init__.py,sha256=Vn2C79OqovFu5wJus9EHsMtK3Of1JLJDcpg2QZKmXsY,1565
4
4
  exa/common/api/proto_serialization/_parameter.py,sha256=W0EBrVs3uZ-jX1HnlOrAB7_PKrzi8D_qNM0_SBht8XY,2895
5
5
  exa/common/api/proto_serialization/array.py,sha256=iht5WlfGEkzXM3PcOFDXxd2TgXWFyYNyPt44CMqXnl8,3110
6
- exa/common/api/proto_serialization/datum.py,sha256=gFIAncWpOhy4V56DKYdKoasEIpGu1yUerSuRQf65unY,4828
6
+ exa/common/api/proto_serialization/datum.py,sha256=i4Ri8VMfbCPV_d6763DDUdHX72tEWxpiOhvIr0lfSlY,4811
7
7
  exa/common/api/proto_serialization/nd_sweep.py,sha256=B36KY32wTNFJE3Bk2QlN4BeMO0Se7AtwOectlIh5SCM,2661
8
- exa/common/api/proto_serialization/sequence.py,sha256=ACmMyDqCWve33GhHTTDjc2LaBorAZ9H1QNyFx4G2Gtc,2536
8
+ exa/common/api/proto_serialization/sequence.py,sha256=mcjquVqVquQmhE5G7cbC3vRax9EkOS6iJk2QXBu1MoQ,2545
9
9
  exa/common/api/proto_serialization/setting_node.py,sha256=KCNpwgwIrgyuXsgt-rAm3oEQqKlIxtN8JBUDFaQTJ48,3940
10
10
  exa/common/control/__init__.py,sha256=00T_xV0lL20QZcEt__vWq81N1oGF0KpJMhTitfAI4VI,629
11
11
  exa/common/control/sweep/__init__.py,sha256=GzKoQdQsLutcHhmrLPyPrW1n7Cpg766p3OWDHlRpuTs,607
@@ -25,23 +25,23 @@ exa/common/control/sweep/option/start_stop_options.py,sha256=HaQFNlhRPep2yrn_LuO
25
25
  exa/common/control/sweep/option/sweep_options.py,sha256=BhKB7RHP0VXJ9iUQKVzeQOM4j_x9AsMhRJgoR3gkiaY,933
26
26
  exa/common/data/__init__.py,sha256=F5SRe5QHBTjef4XJVQ63kO5Oxc_AiZnPbV560i7La0Y,644
27
27
  exa/common/data/base_model.py,sha256=Zap09R91zHY3iYtfO-SqxfKdewCf3q5FNi1uefTtSfQ,1796
28
- exa/common/data/parameter.py,sha256=eOssAtz34Y9MzZ0BZlUkJeOGaFVISH8aiPZE7QTMHo8,23166
29
- exa/common/data/setting_node.py,sha256=WldawevXuOb2uN-bjZ04hWijKqX_MOdkyMsgxOZbrek,43190
28
+ exa/common/data/parameter.py,sha256=OTlBPtuMkiHNozIVzsgUn5wOg3cvaXUcqVpTOHyN12c,23193
29
+ exa/common/data/setting_node.py,sha256=p-RnZc1H0Nwxanexoejay8c0TsDCDggDQB1Z3S_YEjg,43190
30
30
  exa/common/data/settingnode_v2.html.jinja2,sha256=mo-rlLLmU-Xxf6znJAisispAZK8sbV-2C13byKAtj_Q,3166
31
31
  exa/common/data/value.py,sha256=mtMws5UPGx1pCADK6Q2Tx4BwCXznvVRSNQRfcQ3NMmY,1853
32
32
  exa/common/errors/__init__.py,sha256=ArMBdpmx1EUenBpzrSNG63kmUf7PM0gCqSYnaCnL9Qk,597
33
33
  exa/common/errors/exa_error.py,sha256=iw8ueZgqx1JXkfjRoJfPUsSE7cfhzIWpdDaFuka9Ss0,990
34
34
  exa/common/errors/server_errors.py,sha256=4BLTUtlJRLTyR1mW2b_mAtkj90UCNZ8pS8-p_SWWfYM,2810
35
35
  exa/common/helpers/__init__.py,sha256=IgtVD3tojIFA4MTV2mT5uYM6jb2qny9kBIIhEZT2PuI,610
36
- exa/common/helpers/data_helper.py,sha256=vhzJ63g1S2JqnCj0WJJuqWcuiIwKATnQeHdWw_3gkZg,1934
36
+ exa/common/helpers/data_helper.py,sha256=qg-RBCGGP947IbZAoFQ0oQrmp2EgzCSgh6kinX2MD9A,1903
37
37
  exa/common/helpers/deprecation.py,sha256=nY8484iun63JOBfBeh49Q6VD5xZ4_gT9fjPmH1RAXoI,397
38
- exa/common/helpers/json_helper.py,sha256=VTcYU8FRgv3tXPifuogUWmVAzt_4JoQ_laTHolyodtA,2672
38
+ exa/common/helpers/json_helper.py,sha256=LoTrL6FREML1o0X3Zznf1baI4kn0kh03NE1nqBHgYss,2699
39
39
  exa/common/helpers/numpy_helper.py,sha256=KKKyZ_fD0O1gn7_InEQROYnX3WGMA6C1qHh8KzzjtUI,1062
40
- exa/common/helpers/software_version_helper.py,sha256=kpuQer4p1p4cj9_CzwziBSCX7wuH-FvfNw8G8U-EI3Y,5162
40
+ exa/common/helpers/software_version_helper.py,sha256=9vczRJFktNycbvB6FbbLDP8ejkRrmkg_-0S46tUfbyQ,5131
41
41
  exa/common/logger/__init__.py,sha256=1bIsGxHzfujXlkgtcAnWToKMkw3dpU5PEd_7LE_NpgQ,686
42
- exa/common/logger/logger.py,sha256=qQOl2MEBlw69zKEKNWSPOFi7DSLOfsMXNmJYapqzlXY,5684
42
+ exa/common/logger/logger.py,sha256=0aSjkx4pXy_CCKtspOnFgwMmhZVFAZUlopQ6HUjBMko,5689
43
43
  exa/common/qcm_data/__init__.py,sha256=VtsYkGoaniSjCkY0oQlqkcYJCtmC2sTDxfrIe_kpqZg,567
44
- exa/common/qcm_data/chad_model.py,sha256=MQ1xuRODOA6uzb3GJ4fgYx9cXS8z1DeRGw6HYKA9Sio,11223
44
+ exa/common/qcm_data/chad_model.py,sha256=kQFCwr7ToONvXySCCrc-_nZDyXJxgYIjtw-IpNwAhkM,11192
45
45
  exa/common/qcm_data/chip_topology.py,sha256=OJU8-CXV7wfdxrn0HqryNZmxGRoffrg0vi0aMaiYbbY,19328
46
46
  exa/common/qcm_data/file_adapter.py,sha256=U1XZm_PEswkW7kAztbWFLMufz4mPKPupWbh5yJXdZCI,2263
47
47
  exa/common/qcm_data/immutable_base_model.py,sha256=QXmKIWQbsbWQvovXwKT1d9jtyf2LNJtjQquIwO52zOU,901
@@ -49,8 +49,8 @@ exa/common/qcm_data/qcm_data_client.py,sha256=0clAbZ3HPBH9lFOe8cVmaq8hPHG5m3pyPG
49
49
  exa/common/sweep/__init__.py,sha256=uEKk5AtzSgSnf8Y0geRPwUpqXIBIXpeCxsN64sX7F1o,591
50
50
  exa/common/sweep/database_serialization.py,sha256=NUu1umxRQZpKtRmw1vNDsSbnofqbHvKFg_xQ2mdhY6k,7469
51
51
  exa/common/sweep/util.py,sha256=-QE2AaH-WDkYAVH5-Z-30leLgY0x4efmby4kc1JTCgY,3732
52
- iqm_exa_common-26.8.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
53
- iqm_exa_common-26.8.dist-info/METADATA,sha256=65WpaWcEgJu2wLjfrEVsg6KiMhOTZuLc2jeIN357hEw,14548
54
- iqm_exa_common-26.8.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
55
- iqm_exa_common-26.8.dist-info/top_level.txt,sha256=Clphg2toaZ3_jSFRPhjMNEmLurkMNMc4lkK2EFYsSlM,4
56
- iqm_exa_common-26.8.dist-info/RECORD,,
52
+ iqm_exa_common-26.10.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
53
+ iqm_exa_common-26.10.dist-info/METADATA,sha256=C1303RkT96c6c3Q5DT35KMHmZk-UAFoN4CfMdH-GW_k,14549
54
+ iqm_exa_common-26.10.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
55
+ iqm_exa_common-26.10.dist-info/top_level.txt,sha256=Clphg2toaZ3_jSFRPhjMNEmLurkMNMc4lkK2EFYsSlM,4
56
+ iqm_exa_common-26.10.dist-info/RECORD,,