iqm-exa-common 26.33.0__py3-none-any.whl → 27.0.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.
@@ -15,13 +15,11 @@
15
15
  """Base immutable class for sweeps specifications."""
16
16
 
17
17
  from typing import Any
18
- import warnings
19
18
 
20
- from exa.common.control.sweep.option import CenterSpanOptions, StartStopOptions, SweepOptions
19
+ from exa.common.control.sweep.option import CenterSpanOptions, StartStopOptions
21
20
  from exa.common.control.sweep.sweep_values import SweepValues
22
21
  from exa.common.data.base_model import BaseModel
23
22
  from exa.common.data.parameter import Parameter
24
- from exa.common.errors.exa_error import InvalidSweepOptionsTypeError
25
23
 
26
24
 
27
25
  class Sweep(BaseModel):
@@ -33,30 +31,6 @@ class Sweep(BaseModel):
33
31
  data: SweepValues
34
32
  """List of values for :attr:`parameter`"""
35
33
 
36
- def __init__(
37
- self, parameter: Parameter, options: SweepOptions | None = None, *, data: SweepValues | None = None, **kwargs
38
- ) -> None:
39
- if options is None and data is None:
40
- raise ValueError("Either 'options' or 'data' is required.")
41
- if options is not None and data is not None:
42
- raise ValueError(
43
- "Can't use both 'options' and 'data' at the same time, give only either of the parameters."
44
- )
45
- if options is not None:
46
- warnings.warn("'options' attribute is deprecated, use 'data' instead.", DeprecationWarning)
47
-
48
- if not isinstance(options, SweepOptions):
49
- raise InvalidSweepOptionsTypeError(str(type(options)))
50
-
51
- if isinstance(options, StartStopOptions):
52
- data = self.__from_start_stop(parameter, options)
53
- elif isinstance(options, CenterSpanOptions):
54
- data = self.__from_center_span(parameter, options)
55
- else:
56
- data = options.data
57
-
58
- super().__init__(parameter=parameter, data=data, **kwargs) # type: ignore[call-arg] # type: ignore[call-arg]
59
-
60
34
  def model_post_init(self, __context: Any) -> None:
61
35
  if not all(self.parameter.validate(value) for value in self.data):
62
36
  raise ValueError(f"Invalid range data {self.data} for parameter type {self.parameter.data_type}.")
@@ -75,6 +49,6 @@ class Sweep(BaseModel):
75
49
  return options.data
76
50
 
77
51
  @staticmethod
78
- def _validate_value(parameter: Parameter, value: int | float | complex | str | bool, value_label: str):
52
+ def _validate_value(parameter: Parameter, value: complex | str | bool, value_label: str) -> None:
79
53
  if not parameter.validate(value):
80
54
  raise ValueError(f"Invalid {value_label} value {value} for parameter type {parameter.data_type}.")
@@ -1,8 +1,3 @@
1
- from typing_extensions import deprecated
2
-
3
- from exa.common.helpers.deprecation import format_deprecated
4
-
5
-
6
1
  class ExaError(Exception):
7
2
  """Base class for exa errors.
8
3
 
@@ -11,11 +6,11 @@ class ExaError(Exception):
11
6
 
12
7
  """
13
8
 
14
- def __init__(self, message: str, *args):
9
+ def __init__(self, message: str, *args) -> None:
15
10
  super().__init__(message, *args)
16
11
  self.message = message
17
12
 
18
- def __str__(self):
13
+ def __str__(self) -> str:
19
14
  return self.message
20
15
 
21
16
 
@@ -25,11 +20,3 @@ class UnknownSettingError(ExaError, AttributeError):
25
20
 
26
21
  class EmptyComponentListError(ExaError, ValueError):
27
22
  """Error raised when an empty list is given as components for running an experiment."""
28
-
29
-
30
- @deprecated(format_deprecated(old="`InvalidSweepOptionsTypeError`", new="`Sweep.data`", since="28.3.2025"))
31
- class InvalidSweepOptionsTypeError(ExaError, TypeError):
32
- """The type of sweep options is invalid."""
33
-
34
- def __init__(self, options: str, *args):
35
- super().__init__(f"Options have unsupported type of {options}", *args)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-exa-common
3
- Version: 26.33.0
3
+ Version: 27.0.0
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
@@ -10,10 +10,7 @@ exa/common/api/proto_serialization/sequence.py,sha256=4yQgdTUenbsY8yNu7JqSQSq2Us
10
10
  exa/common/api/proto_serialization/setting_node.py,sha256=oAlJOmkQTmMSd6wpofoDLz3YIlkiqxX7kY84WnZZ4b4,4073
11
11
  exa/common/control/__init__.py,sha256=00T_xV0lL20QZcEt__vWq81N1oGF0KpJMhTitfAI4VI,629
12
12
  exa/common/control/sweep/__init__.py,sha256=GzKoQdQsLutcHhmrLPyPrW1n7Cpg766p3OWDHlRpuTs,607
13
- exa/common/control/sweep/exponential_sweep.py,sha256=OIGqSifkAgQcS2EdffDpIjibB80XteLVF82kS63vPro,2121
14
- exa/common/control/sweep/fixed_sweep.py,sha256=QXO5lrllHHlhLiA95s8iTE82QkAEzgjJ2dA0flRJLhs,1493
15
- exa/common/control/sweep/linear_sweep.py,sha256=fX7OuZDYtUSGcAJLsGTVHcCIRkUHkZNLy5YSe_kgb8M,1966
16
- exa/common/control/sweep/sweep.py,sha256=CeCd7-nh0nIlaay4ggMICu61anVxlg3MISGhkK44-VQ,3520
13
+ exa/common/control/sweep/sweep.py,sha256=7iaW_8baA0vZZjR7s6P1jkkG-B5Ncjez25xyExbKlf4,2260
17
14
  exa/common/control/sweep/sweep_values.py,sha256=c868qpnh3SP6DYN3eAt0SLaePuzzQwxTWYwnQwL4A-I,2277
18
15
  exa/common/control/sweep/option/__init__.py,sha256=Z01JS0FpchMvR8zfWBCs3jcPjh2H8X29YkN0SFxWLTY,906
19
16
  exa/common/control/sweep/option/center_span_base_options.py,sha256=uHWt4euQVF7EVXJid8wnIXo8PtJnyUdydxxAXPEMnV4,2558
@@ -31,7 +28,7 @@ exa/common/data/setting_node.py,sha256=rTXo-D9v42L8HkJoNoCMtm8cyUEuNtpYGhHfi45ZP
31
28
  exa/common/data/settingnode_v2.html.jinja2,sha256=mo-rlLLmU-Xxf6znJAisispAZK8sbV-2C13byKAtj_Q,3166
32
29
  exa/common/data/value.py,sha256=mtMws5UPGx1pCADK6Q2Tx4BwCXznvVRSNQRfcQ3NMmY,1853
33
30
  exa/common/errors/__init__.py,sha256=ArMBdpmx1EUenBpzrSNG63kmUf7PM0gCqSYnaCnL9Qk,597
34
- exa/common/errors/exa_error.py,sha256=iw8ueZgqx1JXkfjRoJfPUsSE7cfhzIWpdDaFuka9Ss0,990
31
+ exa/common/errors/exa_error.py,sha256=wFfJbdeGs15XVF0VJvXPEjNavC2hXVJjchFcLfCfAiw,560
35
32
  exa/common/errors/station_control_errors.py,sha256=s0LimSOthQF8NWKyW556p-9vEapOxtn_W5ZiZVPTv_g,4489
36
33
  exa/common/helpers/__init__.py,sha256=IgtVD3tojIFA4MTV2mT5uYM6jb2qny9kBIIhEZT2PuI,610
37
34
  exa/common/helpers/data_helper.py,sha256=-AP0vwrf7WgyumLsicDtNP2VP5rhG4_oiOZgG4alNb4,2001
@@ -51,8 +48,8 @@ exa/common/qcm_data/qcm_data_client.py,sha256=Rze6yQd0xUeH6eUMv3wduYbiDCTP3C4WEC
51
48
  exa/common/sweep/__init__.py,sha256=uEKk5AtzSgSnf8Y0geRPwUpqXIBIXpeCxsN64sX7F1o,591
52
49
  exa/common/sweep/database_serialization.py,sha256=9n96OqmEnjy1x2F1HwaNOQgwX_39HjLtE9EUoetSw0E,7493
53
50
  exa/common/sweep/util.py,sha256=-QE2AaH-WDkYAVH5-Z-30leLgY0x4efmby4kc1JTCgY,3732
54
- iqm_exa_common-26.33.0.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
55
- iqm_exa_common-26.33.0.dist-info/METADATA,sha256=YnFvhRiZetp91TDRdJBb0Jsr5DQNVpteUTMXkeqc-zA,14742
56
- iqm_exa_common-26.33.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
57
- iqm_exa_common-26.33.0.dist-info/top_level.txt,sha256=Clphg2toaZ3_jSFRPhjMNEmLurkMNMc4lkK2EFYsSlM,4
58
- iqm_exa_common-26.33.0.dist-info/RECORD,,
51
+ iqm_exa_common-27.0.0.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
52
+ iqm_exa_common-27.0.0.dist-info/METADATA,sha256=HSADQ--8rxKTImWGTmuX7t6lDJ1Tajdke8LLVC98trw,14741
53
+ iqm_exa_common-27.0.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
54
+ iqm_exa_common-27.0.0.dist-info/top_level.txt,sha256=Clphg2toaZ3_jSFRPhjMNEmLurkMNMc4lkK2EFYsSlM,4
55
+ iqm_exa_common-27.0.0.dist-info/RECORD,,
@@ -1,53 +0,0 @@
1
- # Copyright 2024 IQM
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- """Sweep specification with exponentially spaced values."""
16
-
17
- from typing import Any
18
-
19
- from typing_extensions import deprecated
20
-
21
- from exa.common.control.sweep.option import CenterSpanBaseOptions, StartStopBaseOptions
22
- from exa.common.control.sweep.sweep import Sweep
23
- from exa.common.data.parameter import Parameter
24
- from exa.common.errors.exa_error import InvalidSweepOptionsTypeError
25
- from exa.common.helpers.deprecation import format_deprecated
26
-
27
-
28
- @deprecated(format_deprecated(old="`ExponentialSweep`", new="`Sweep`", since="28.3.2025"))
29
- class ExponentialSweep(Sweep):
30
- """Generates parameter values spaced evenly on a geometric progression based on `options`.
31
-
32
- - If `options` is instance of :class:`.StartStopBaseOptions`,
33
- the start and stop of the interval are calculated from powers of start and stop.
34
- - If `options` is instance of :class:`.CenterSpanBaseOptions`,
35
- the start and stop of the interval are calculated from powers of start and stop,
36
- which are derived from center and span.
37
-
38
- Raises:
39
- ValueError: Error is raised if `options` is inconsistent.
40
-
41
- """
42
-
43
- def __init__(
44
- self,
45
- parameter: Parameter,
46
- options: StartStopBaseOptions | CenterSpanBaseOptions | None = None,
47
- *,
48
- data: list[Any] | None = None,
49
- **kwargs,
50
- ) -> None:
51
- if options and not isinstance(options, StartStopBaseOptions | CenterSpanBaseOptions):
52
- raise InvalidSweepOptionsTypeError(str(type(options)))
53
- super().__init__(parameter, options, data=data, **kwargs)
@@ -1,37 +0,0 @@
1
- # Copyright 2024 IQM
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- """Sweep specification with arbitrary values."""
16
-
17
- from typing import Any
18
-
19
- from typing_extensions import deprecated
20
-
21
- from exa.common.control.sweep.option import FixedOptions
22
- from exa.common.control.sweep.sweep import Sweep
23
- from exa.common.data.parameter import Parameter
24
- from exa.common.errors.exa_error import InvalidSweepOptionsTypeError
25
- from exa.common.helpers.deprecation import format_deprecated
26
-
27
-
28
- @deprecated(format_deprecated(old="`FixedSweep`", new="`Sweep`", since="28.3.2025"))
29
- class FixedSweep(Sweep):
30
- """A sweep over arbitrary set of values, given by `options`."""
31
-
32
- def __init__(
33
- self, parameter: Parameter, options: FixedOptions | None = None, *, data: list[Any] | None = None, **kwargs
34
- ) -> None:
35
- if options and not isinstance(options, FixedOptions):
36
- raise InvalidSweepOptionsTypeError(str(type(options)))
37
- super().__init__(parameter, options, data=data, **kwargs)
@@ -1,51 +0,0 @@
1
- # Copyright 2024 IQM
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- """Sweep specification with linearly spaced values."""
16
-
17
- from typing import Any
18
-
19
- from typing_extensions import deprecated
20
-
21
- from exa.common.control.sweep.option import CenterSpanOptions, StartStopOptions
22
- from exa.common.control.sweep.sweep import Sweep
23
- from exa.common.data.parameter import Parameter
24
- from exa.common.errors.exa_error import InvalidSweepOptionsTypeError
25
- from exa.common.helpers.deprecation import format_deprecated
26
-
27
-
28
- @deprecated(format_deprecated(old="`LinearSweep`", new="`Sweep`", since="28.3.2025"))
29
- class LinearSweep(Sweep):
30
- """Generates evenly spaced parameter values based on `options`.
31
-
32
- - If `options` is instance of :class:`.StartStopOptions`, then start and stop options are used for interval
33
- - If `options` is instance of :class:`.CenterSpanOptions`,
34
- then the start and stop of the interval are calculated from center and span values
35
-
36
- Raises:
37
- ValueError: Error is raised if `options` is inconsistent.
38
-
39
- """
40
-
41
- def __init__(
42
- self,
43
- parameter: Parameter,
44
- options: StartStopOptions | CenterSpanOptions | None = None,
45
- *,
46
- data: list[Any] | None = None,
47
- **kwargs,
48
- ) -> None:
49
- if options and not isinstance(options, StartStopOptions | CenterSpanOptions):
50
- raise InvalidSweepOptionsTypeError(str(type(options)))
51
- super().__init__(parameter, options, data=data, **kwargs)