iqm-exa-common 26.33.0__tar.gz → 27.1.0__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.
Files changed (84) hide show
  1. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/CHANGELOG.rst +16 -0
  2. {iqm_exa_common-26.33.0/src/iqm_exa_common.egg-info → iqm_exa_common-27.1.0}/PKG-INFO +1 -1
  3. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/control/sweep/sweep.py +2 -28
  4. iqm_exa_common-27.1.0/src/exa/common/errors/exa_error.py +22 -0
  5. iqm_exa_common-27.1.0/src/exa/common/qcm_data/chip_layout.py +123 -0
  6. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0/src/iqm_exa_common.egg-info}/PKG-INFO +1 -1
  7. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/iqm_exa_common.egg-info/SOURCES.txt +1 -3
  8. iqm_exa_common-27.1.0/version.txt +1 -0
  9. iqm_exa_common-26.33.0/src/exa/common/control/sweep/exponential_sweep.py +0 -53
  10. iqm_exa_common-26.33.0/src/exa/common/control/sweep/fixed_sweep.py +0 -37
  11. iqm_exa_common-26.33.0/src/exa/common/control/sweep/linear_sweep.py +0 -51
  12. iqm_exa_common-26.33.0/src/exa/common/errors/exa_error.py +0 -35
  13. iqm_exa_common-26.33.0/version.txt +0 -1
  14. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/LICENSE.txt +0 -0
  15. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/MANIFEST.in +0 -0
  16. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/README.rst +0 -0
  17. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/docs/API.rst +0 -0
  18. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/docs/Makefile +0 -0
  19. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/docs/_static/.gitignore +0 -0
  20. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/docs/_static/css/custom.css +0 -0
  21. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/docs/_static/images/favicon.ico +0 -0
  22. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/docs/_static/images/logo.png +0 -0
  23. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/docs/_templates/autosummary-class-template.rst +0 -0
  24. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/docs/_templates/autosummary-module-template.rst +0 -0
  25. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/docs/changelog.rst +0 -0
  26. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/docs/conf.py +0 -0
  27. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/docs/index.rst +0 -0
  28. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/docs/license.rst +0 -0
  29. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/pyproject.toml +0 -0
  30. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/requirements/base.in +0 -0
  31. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/requirements/base.txt +0 -0
  32. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/setup.cfg +0 -0
  33. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/setup.py +0 -0
  34. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/__init__.py +0 -0
  35. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/api/__init__.py +0 -0
  36. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/api/proto_serialization/__init__.py +0 -0
  37. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/api/proto_serialization/_parameter.py +0 -0
  38. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/api/proto_serialization/array.py +0 -0
  39. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/api/proto_serialization/datum.py +0 -0
  40. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/api/proto_serialization/nd_sweep.py +0 -0
  41. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/api/proto_serialization/sequence.py +0 -0
  42. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/api/proto_serialization/setting_node.py +0 -0
  43. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/control/__init__.py +0 -0
  44. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/control/sweep/__init__.py +0 -0
  45. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/control/sweep/option/__init__.py +0 -0
  46. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/control/sweep/option/center_span_base_options.py +0 -0
  47. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/control/sweep/option/center_span_options.py +0 -0
  48. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/control/sweep/option/constants.py +0 -0
  49. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/control/sweep/option/fixed_options.py +0 -0
  50. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/control/sweep/option/option_converter.py +0 -0
  51. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/control/sweep/option/start_stop_base_options.py +0 -0
  52. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/control/sweep/option/start_stop_options.py +0 -0
  53. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/control/sweep/option/sweep_options.py +0 -0
  54. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/control/sweep/sweep_values.py +0 -0
  55. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/data/__init__.py +0 -0
  56. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/data/base_model.py +0 -0
  57. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/data/parameter.py +0 -0
  58. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/data/setting_node.py +0 -0
  59. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/data/settingnode_v2.html.jinja2 +0 -0
  60. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/data/value.py +0 -0
  61. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/errors/__init__.py +0 -0
  62. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/errors/station_control_errors.py +0 -0
  63. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/helpers/__init__.py +0 -0
  64. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/helpers/data_helper.py +0 -0
  65. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/helpers/deprecation.py +0 -0
  66. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/helpers/json_helper.py +0 -0
  67. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/helpers/numpy_helper.py +0 -0
  68. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/helpers/software_version_helper.py +0 -0
  69. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/helpers/yaml_helper.py +0 -0
  70. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/logger/__init__.py +0 -0
  71. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/logger/logger.py +0 -0
  72. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/py.typed +0 -0
  73. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/qcm_data/__init__.py +0 -0
  74. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/qcm_data/chad_model.py +0 -0
  75. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/qcm_data/chip_topology.py +0 -0
  76. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/qcm_data/file_adapter.py +0 -0
  77. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/qcm_data/immutable_base_model.py +0 -0
  78. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/qcm_data/qcm_data_client.py +0 -0
  79. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/sweep/__init__.py +0 -0
  80. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/sweep/database_serialization.py +0 -0
  81. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/exa/common/sweep/util.py +0 -0
  82. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/iqm_exa_common.egg-info/dependency_links.txt +0 -0
  83. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/iqm_exa_common.egg-info/requires.txt +0 -0
  84. {iqm_exa_common-26.33.0 → iqm_exa_common-27.1.0}/src/iqm_exa_common.egg-info/top_level.txt +0 -0
@@ -2,6 +2,22 @@
2
2
  Changelog
3
3
  =========
4
4
 
5
+ Version 27.1.0 (2025-09-19)
6
+ ===========================
7
+
8
+ Features
9
+ --------
10
+
11
+ - Add chip layout to hold the coordinates of the chip design record.
12
+
13
+ Version 27.0.0 (2025-09-12)
14
+ ===========================
15
+
16
+ Breaking changes
17
+ ----------------
18
+
19
+ - Remove deprecated sweeps.
20
+
5
21
  Version 26.33.0 (2025-09-03)
6
22
  ============================
7
23
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-exa-common
3
- Version: 26.33.0
3
+ Version: 27.1.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
@@ -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}.")
@@ -0,0 +1,22 @@
1
+ class ExaError(Exception):
2
+ """Base class for exa errors.
3
+
4
+ Attributes:
5
+ message: Error message.
6
+
7
+ """
8
+
9
+ def __init__(self, message: str, *args) -> None:
10
+ super().__init__(message, *args)
11
+ self.message = message
12
+
13
+ def __str__(self) -> str:
14
+ return self.message
15
+
16
+
17
+ class UnknownSettingError(ExaError, AttributeError):
18
+ """This SettingNode does not have a given key."""
19
+
20
+
21
+ class EmptyComponentListError(ExaError, ValueError):
22
+ """Error raised when an empty list is given as components for running an experiment."""
@@ -0,0 +1,123 @@
1
+ # Copyright 2025 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
+ """Chip layout class."""
16
+
17
+ from __future__ import annotations
18
+
19
+ from functools import cached_property
20
+
21
+ import numpy as np
22
+
23
+ from exa.common.errors.exa_error import ExaError
24
+
25
+
26
+ class ChipLayout:
27
+ """The chip layout contains the components and their 2D cartesian coordinates."""
28
+
29
+ def __init__(
30
+ self,
31
+ qubits: dict[str, tuple[float, float]],
32
+ couplers: dict[str, tuple[float, float]],
33
+ computational_resonators: dict[str, tuple[float, float]],
34
+ ) -> None:
35
+ self._qubits = list(qubits)
36
+ self._couplers = list(couplers)
37
+ self._computational_resonators = list(computational_resonators)
38
+ self._coordinates = {
39
+ comp: (x, y) for comp, (x, y) in [*qubits.items(), *couplers.items(), *computational_resonators.items()]
40
+ }
41
+
42
+ @classmethod
43
+ def from_chip_design_record(cls, record: dict) -> ChipLayout:
44
+ """Construct the chip layout from a raw chip design record.
45
+
46
+ Args:
47
+ record: The chip design record as returned by station control.
48
+
49
+ Returns:
50
+ The corresponding chip layout.
51
+
52
+ """
53
+ qubits = record["content"]["components"].get("qubit", [])
54
+ couplers = record["content"]["components"].get("tunable_coupler", [])
55
+ comprs = record["content"]["components"].get("computational_resonator", [])
56
+ if all("locations" in component for component in [*qubits, *couplers, *comprs]):
57
+ return cls(
58
+ qubits={
59
+ qubit["name"]: (qubit["locations"]["metro"]["x"], qubit["locations"]["metro"]["y"])
60
+ for qubit in qubits
61
+ },
62
+ couplers={
63
+ coupler["name"]: (coupler["locations"]["metro"]["x"], coupler["locations"]["metro"]["y"])
64
+ for coupler in couplers
65
+ },
66
+ computational_resonators={
67
+ compr["name"]: (compr["locations"]["metro"]["x"], compr["locations"]["metro"]["y"])
68
+ for compr in comprs
69
+ },
70
+ )
71
+ raise ExaError("Chip design record is missing locations.")
72
+
73
+ def normalize_coordinates(self, scale: float) -> None:
74
+ self._coordinates = {comp: (xx * scale, yy * scale) for comp, (xx, yy) in self._coordinates.items()}
75
+
76
+ def mirror_yaxis(self) -> None:
77
+ self._coordinates = {comp: (xx, -yy) for comp, (xx, yy) in self._coordinates.items()}
78
+
79
+ def rotate_layout(self) -> None:
80
+ self._coordinates = {
81
+ comp: ((xx + yy) / np.sqrt(2), (-xx + yy) / np.sqrt(2)) for comp, (xx, yy) in self._coordinates.items()
82
+ }
83
+
84
+ def move_origin(self) -> None:
85
+ x_min, y_min = (
86
+ min([xx for comp, (xx, yy) in self._coordinates.items()]),
87
+ min([yy for comp, (xx, yy) in self._coordinates.items()]),
88
+ )
89
+ self._coordinates = {comp: (xx - x_min, yy - y_min) for comp, (xx, yy) in self._coordinates.items()}
90
+
91
+ @property
92
+ def qubits(self) -> list[str]:
93
+ return self._qubits
94
+
95
+ @property
96
+ def couplers(self) -> list[str]:
97
+ return self._couplers
98
+
99
+ @property
100
+ def computational_resonators(self) -> list[str]:
101
+ return self._computational_resonators
102
+
103
+ @cached_property
104
+ def components(self) -> list[str]:
105
+ return [*self._qubits, *self._couplers, *self._computational_resonators]
106
+
107
+ def get_coordinates(self, component: str) -> tuple[float, float]:
108
+ """Get the coordinates for the given component.
109
+
110
+ Args:
111
+ component: The name of the component.
112
+
113
+ Returns:
114
+ The 2D cartesian coordinates.
115
+
116
+ """
117
+ if component not in self.components:
118
+ raise ValueError(f"Component {component} not in chip layout.")
119
+ return self._coordinates[component]
120
+
121
+ def get_all_qubit_coordinates(self) -> dict[str, tuple[float, float]]:
122
+ """Get the coordinates for all qubits."""
123
+ return {qubit: self._coordinates[qubit] for qubit in self._qubits}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-exa-common
3
- Version: 26.33.0
3
+ Version: 27.1.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
@@ -31,9 +31,6 @@ src/exa/common/api/proto_serialization/sequence.py
31
31
  src/exa/common/api/proto_serialization/setting_node.py
32
32
  src/exa/common/control/__init__.py
33
33
  src/exa/common/control/sweep/__init__.py
34
- src/exa/common/control/sweep/exponential_sweep.py
35
- src/exa/common/control/sweep/fixed_sweep.py
36
- src/exa/common/control/sweep/linear_sweep.py
37
34
  src/exa/common/control/sweep/sweep.py
38
35
  src/exa/common/control/sweep/sweep_values.py
39
36
  src/exa/common/control/sweep/option/__init__.py
@@ -65,6 +62,7 @@ src/exa/common/logger/__init__.py
65
62
  src/exa/common/logger/logger.py
66
63
  src/exa/common/qcm_data/__init__.py
67
64
  src/exa/common/qcm_data/chad_model.py
65
+ src/exa/common/qcm_data/chip_layout.py
68
66
  src/exa/common/qcm_data/chip_topology.py
69
67
  src/exa/common/qcm_data/file_adapter.py
70
68
  src/exa/common/qcm_data/immutable_base_model.py
@@ -0,0 +1 @@
1
+ 27.1.0
@@ -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)
@@ -1,35 +0,0 @@
1
- from typing_extensions import deprecated
2
-
3
- from exa.common.helpers.deprecation import format_deprecated
4
-
5
-
6
- class ExaError(Exception):
7
- """Base class for exa errors.
8
-
9
- Attributes:
10
- message: Error message.
11
-
12
- """
13
-
14
- def __init__(self, message: str, *args):
15
- super().__init__(message, *args)
16
- self.message = message
17
-
18
- def __str__(self):
19
- return self.message
20
-
21
-
22
- class UnknownSettingError(ExaError, AttributeError):
23
- """This SettingNode does not have a given key."""
24
-
25
-
26
- class EmptyComponentListError(ExaError, ValueError):
27
- """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 +0,0 @@
1
- 26.33.0