iqm-exa-common 25.33__tar.gz → 26.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 (90) hide show
  1. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/CHANGELOG.rst +86 -33
  2. {iqm_exa_common-25.33/src/iqm_exa_common.egg-info → iqm_exa_common-26.0}/PKG-INFO +2 -2
  3. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/requirements/base.in +1 -1
  4. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/requirements/base.txt +1 -1
  5. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/api/proto_serialization/_parameter.py +4 -3
  6. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/api/proto_serialization/nd_sweep.py +3 -8
  7. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/api/proto_serialization/sequence.py +5 -5
  8. iqm_exa_common-26.0/src/exa/common/control/sweep/exponential_sweep.py +51 -0
  9. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/control/sweep/fixed_sweep.py +10 -14
  10. iqm_exa_common-26.0/src/exa/common/control/sweep/linear_sweep.py +49 -0
  11. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/control/sweep/option/__init__.py +1 -1
  12. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/control/sweep/option/center_span_base_options.py +14 -7
  13. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/control/sweep/option/center_span_options.py +13 -6
  14. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/control/sweep/option/constants.py +2 -2
  15. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/control/sweep/option/fixed_options.py +8 -2
  16. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/control/sweep/option/option_converter.py +4 -8
  17. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/control/sweep/option/start_stop_base_options.py +20 -6
  18. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/control/sweep/option/start_stop_options.py +20 -5
  19. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/control/sweep/option/sweep_options.py +9 -0
  20. iqm_exa_common-26.0/src/exa/common/control/sweep/sweep.py +80 -0
  21. iqm_exa_common-26.0/src/exa/common/control/sweep/sweep_values.py +58 -0
  22. iqm_exa_common-26.0/src/exa/common/data/base_model.py +40 -0
  23. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/data/parameter.py +123 -68
  24. iqm_exa_common-26.0/src/exa/common/data/setting_node.py +1052 -0
  25. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/data/settingnode_v2.html.jinja2 +6 -6
  26. iqm_exa_common-26.0/src/exa/common/data/value.py +49 -0
  27. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/logger/logger.py +1 -1
  28. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/qcm_data/file_adapter.py +2 -6
  29. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/qcm_data/qcm_data_client.py +1 -37
  30. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/sweep/database_serialization.py +30 -98
  31. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/sweep/util.py +4 -5
  32. {iqm_exa_common-25.33 → iqm_exa_common-26.0/src/iqm_exa_common.egg-info}/PKG-INFO +2 -2
  33. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/iqm_exa_common.egg-info/SOURCES.txt +3 -8
  34. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/iqm_exa_common.egg-info/requires.txt +1 -1
  35. iqm_exa_common-26.0/version.txt +1 -0
  36. iqm_exa_common-25.33/src/exa/common/api/model/__init__.py +0 -15
  37. iqm_exa_common-25.33/src/exa/common/api/model/parameter_model.py +0 -111
  38. iqm_exa_common-25.33/src/exa/common/api/model/setting_model.py +0 -63
  39. iqm_exa_common-25.33/src/exa/common/api/model/setting_node_model.py +0 -72
  40. iqm_exa_common-25.33/src/exa/common/api/model/sweep_model.py +0 -63
  41. iqm_exa_common-25.33/src/exa/common/control/sweep/exponential_sweep.py +0 -83
  42. iqm_exa_common-25.33/src/exa/common/control/sweep/function_sweep.py +0 -35
  43. iqm_exa_common-25.33/src/exa/common/control/sweep/linear_sweep.py +0 -74
  44. iqm_exa_common-25.33/src/exa/common/control/sweep/option/function_options.py +0 -26
  45. iqm_exa_common-25.33/src/exa/common/control/sweep/sweep.py +0 -44
  46. iqm_exa_common-25.33/src/exa/common/control/sweep/utils.py +0 -43
  47. iqm_exa_common-25.33/src/exa/common/data/setting_node.py +0 -706
  48. iqm_exa_common-25.33/version.txt +0 -1
  49. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/LICENSE.txt +0 -0
  50. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/MANIFEST.in +0 -0
  51. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/README.rst +0 -0
  52. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/docs/API.rst +0 -0
  53. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/docs/Makefile +0 -0
  54. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/docs/_static/.gitignore +0 -0
  55. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/docs/_static/css/custom.css +0 -0
  56. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/docs/_static/images/favicon.ico +0 -0
  57. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/docs/_static/images/logo.png +0 -0
  58. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/docs/_templates/autosummary-class-template.rst +0 -0
  59. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/docs/_templates/autosummary-module-template.rst +0 -0
  60. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/docs/changelog.rst +0 -0
  61. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/docs/conf.py +0 -0
  62. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/docs/index.rst +0 -0
  63. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/docs/license.rst +0 -0
  64. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/pyproject.toml +0 -0
  65. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/setup.cfg +0 -0
  66. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/setup.py +0 -0
  67. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/__init__.py +0 -0
  68. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/api/__init__.py +0 -0
  69. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/api/proto_serialization/__init__.py +0 -0
  70. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/api/proto_serialization/array.py +0 -0
  71. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/api/proto_serialization/datum.py +0 -0
  72. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/api/proto_serialization/setting_node.py +0 -0
  73. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/control/__init__.py +0 -0
  74. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/control/sweep/__init__.py +0 -0
  75. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/data/__init__.py +0 -0
  76. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/errors/__init__.py +0 -0
  77. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/errors/exa_error.py +0 -0
  78. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/helpers/__init__.py +0 -0
  79. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/helpers/data_helper.py +0 -0
  80. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/helpers/json_helper.py +0 -0
  81. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/helpers/numpy_helper.py +0 -0
  82. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/helpers/software_version_helper.py +0 -0
  83. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/logger/__init__.py +0 -0
  84. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/qcm_data/__init__.py +0 -0
  85. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/qcm_data/chad_model.py +0 -0
  86. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/qcm_data/chip_topology.py +0 -0
  87. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/qcm_data/immutable_base_model.py +0 -0
  88. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/exa/common/sweep/__init__.py +0 -0
  89. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/iqm_exa_common.egg-info/dependency_links.txt +0 -0
  90. {iqm_exa_common-25.33 → iqm_exa_common-26.0}/src/iqm_exa_common.egg-info/top_level.txt +0 -0
@@ -2,8 +2,61 @@
2
2
  Changelog
3
3
  =========
4
4
 
5
+ Version 26.0 (2025-02-27)
6
+ =========================
7
+
8
+
9
+ Features
10
+ --------
11
+
12
+ Breaking changes
13
+ ****************
14
+
15
+ - Remove Pydantic based ``ParameterModel``, ``SettingModel``, ``SettingNodeModel``, and ``SweepModel``,
16
+ and inherit ``Parameter``, ``Setting``, ``SettingNode``, and ``Sweep`` from Pydantic model directly.
17
+ As a result, the signature of usage has changed. :issue:`SW-798`
18
+ - Instead of ``copy``, ``model_copy`` (with an optional ``update`` parameter) should be used.
19
+ - For deserialization, for now, use :meth:`SettingNode.deserialize` (Pydantic native approach will be implemented later)
20
+ - ``FunctionSweep`` and ``FunctionOptions`` has been deleted.
21
+ - :class:`.SettingNode` now supports "the path notation" when inserting/getting nodes
22
+
23
+ - Example: ``settings["flux.my.new.path.foo"] = SettingNode(...)`` adds the specified node under the specified path.
24
+ Any missing subnodes will be added.
25
+
26
+ - :class:`.SettingNode` and :class:`.Setting` now have an attribute ``path`` which will be populated by their relative
27
+ path within the settings tree when inserting/creating the node. The base class will also automatically align the name
28
+ of a node with its path, but there is an attribute ``align_name`` which can be set to ``False`` to not align
29
+ (used e.g. in the controllers section of the EXA settings tree).
30
+ - Remove deprecated ``QCMClient.get_chad`` and ``QCMClient.get_qubit_design_properties``.
31
+
32
+ Features
33
+ --------
34
+
35
+ - Settings can now be declared read-only by setting ``read_only = True`` when
36
+ initialising the setting.
37
+ - Modified the html representation of settings tree to support read_only settings.
38
+ - Methods :meth:`.SettingNode.get_gate_node_for_locus`, :meth:`.SettingNode.get_gate_properties_for_locus`,
39
+ :meth:`.SettingNode.get_default_implementation`, and :meth:`.SettingNode.get_locus_node_paths_for` added
40
+ for accessing EXA-specific gate/characterization nodes in the settings tree.
41
+ - Methods :meth:`.SettingNode.add_for_path` and :meth:`.get_node_for_path` that facilitate dealing with long paths
42
+ in setting trees.
43
+ in setting trees.
44
+ - ``Sweep.options`` is deprecated, use ``Sweep.data`` instead. ``data`` can be still generated using different
45
+ sweep options.
46
+ - ``ExponentialSweep``, ``FixedSweep``, and ``LinearSweep`` are deprecated, use ``Sweep`` instead.
47
+ - Split ``DataType.NUMBER`` to ``DataType.FLOAT`` and ``DataType.INT``. ``DataType.NUMBER`` is now handled as a
48
+ deprecated alias for ``DataType.FLOAT``.
49
+
50
+ Version 25.34 (2025-02-06)
51
+ ==========================
52
+
53
+ Bug fixes
54
+ ---------
55
+
56
+ - Bump mechanize test dependency.
57
+
5
58
  Version 25.33 (2025-02-04)
6
- --------------------------
59
+ ==========================
7
60
 
8
61
  Features
9
62
  --------
@@ -12,7 +65,7 @@ Features
12
65
 
13
66
 
14
67
  Version 25.32 (2025-02-04)
15
- --------------------------
68
+ ==========================
16
69
 
17
70
  Features
18
71
  --------
@@ -21,14 +74,14 @@ Features
21
74
 
22
75
 
23
76
  Version 25.31 (2025-01-28)
24
- --------------------------
77
+ ==========================
25
78
 
26
79
  Features
27
80
  ********
28
81
  - Support broader range of `numpy` versions and verify compatibily with ruff, see migration guide `https://numpy.org/doc/stable/numpy_2_0_migration_guide.html`.
29
82
 
30
83
  Version 25.30 (2025-01-28)
31
- --------------------------
84
+ ==========================
32
85
 
33
86
  Bug Fixes
34
87
  ---------
@@ -37,7 +90,7 @@ Bug Fixes
37
90
  computational resonators.
38
91
 
39
92
  Version 25.29 (2025-01-27)
40
- --------------------------
93
+ ==========================
41
94
 
42
95
  Features
43
96
  --------
@@ -45,7 +98,7 @@ Features
45
98
  - Bump version for an updated repo organization. No functional changes. :issue:`SW-1042`
46
99
 
47
100
  Version 25.28 (2025-01-08)
48
- --------------------------
101
+ ==========================
49
102
 
50
103
  Features
51
104
  --------
@@ -53,14 +106,14 @@ Features
53
106
  - Remove gitlab links from public pages. :issue:`SW-776`
54
107
 
55
108
  Version 25.27 (2024-12-19)
56
- --------------------------
109
+ ==========================
57
110
 
58
111
  Features
59
112
  ********
60
113
  - Bumps xarray
61
114
 
62
115
  Version 25.26 (2024-12-12)
63
- --------------------------
116
+ ==========================
64
117
 
65
118
  Features
66
119
  --------
@@ -68,7 +121,7 @@ Features
68
121
  - Bump exa-experiments
69
122
 
70
123
  Version 25.25 (2024-12-11)
71
- --------------------------
124
+ ==========================
72
125
 
73
126
  Features
74
127
  --------
@@ -76,7 +129,7 @@ Features
76
129
  - Fix public PyPI publishing. :issue:`SW-776`
77
130
 
78
131
  Version 25.24 (2024-12-11)
79
- --------------------------
132
+ ==========================
80
133
 
81
134
  Features
82
135
  --------
@@ -84,7 +137,7 @@ Features
84
137
  - Change license info to Apache 2.0. :issue:`SW-776`
85
138
 
86
139
  Version 25.23 (2024-12-09)
87
- --------------------------
140
+ ==========================
88
141
 
89
142
  Features
90
143
  --------
@@ -92,7 +145,7 @@ Features
92
145
  Fix extlinks to MRs and issues in sphinx docs config :issue:`SW-916`
93
146
 
94
147
  Version 25.22 (2024-12-05)
95
- --------------------------
148
+ ==========================
96
149
 
97
150
  Features
98
151
  --------
@@ -100,14 +153,14 @@ Features
100
153
  - Fix intersphinx reference paths in docs :issue:`SW-916`
101
154
 
102
155
  Version 25.21 (2024-12-04)
103
- --------------------------
156
+ ==========================
104
157
 
105
158
  Test
106
159
  ****
107
160
  - Adds unit test for sorting couplers
108
161
 
109
162
  Version 25.20 (2024-12-04)
110
- --------------------------
163
+ ==========================
111
164
 
112
165
  Features
113
166
  --------
@@ -115,7 +168,7 @@ Features
115
168
  - Bump version for an updated repo organization. No functional changes. :issue:`SW-665`
116
169
 
117
170
  Version 25.19 (2024-11-29)
118
- --------------------------
171
+ ==========================
119
172
 
120
173
  Features
121
174
  --------
@@ -124,7 +177,7 @@ Features
124
177
  gates, required for :issue:`GBC-589`.
125
178
 
126
179
  Version 25.18 (2024-11-27)
127
- --------------------------
180
+ ==========================
128
181
 
129
182
  Features
130
183
  --------
@@ -132,7 +185,7 @@ Features
132
185
  - Expand allowed CHEDDAR versions in `qcm_data_client` to include versions 2.x.
133
186
 
134
187
  Version 25.17 (2024-11-19)
135
- --------------------------
188
+ ==========================
136
189
 
137
190
  Features
138
191
  --------
@@ -140,7 +193,7 @@ Features
140
193
  - Bump version for an updated repo organization. No functional changes. :issue:`SW-774`
141
194
 
142
195
  Version 25.16 (2024-11-15)
143
- --------------------------
196
+ ==========================
144
197
 
145
198
  Bug fixes
146
199
  ---------
@@ -148,7 +201,7 @@ Bug fixes
148
201
  - Remove iqm-internal web links in customer docs artifacts.
149
202
 
150
203
  Version 25.15 (2024-11-08)
151
- --------------------------
204
+ ==========================
152
205
 
153
206
  Features
154
207
  --------
@@ -156,43 +209,43 @@ Features
156
209
  - New changelog workflow, no functional changes. :issue:`SW-774`
157
210
 
158
211
  Version 25.14 (2024-10-30)
159
- --------------------------
212
+ ==========================
160
213
 
161
214
  - Bump Pydantic to version 2.9.2, :issue:`SW-804`.
162
215
 
163
216
 
164
217
  Version 25.13 (2024-10-28)
165
- --------------------------
218
+ ==========================
166
219
 
167
220
  - Bump NumPy to version 1.25.2.
168
221
 
169
222
 
170
223
  Version 25.12 (2024-10-24)
171
- --------------------------
224
+ ==========================
172
225
 
173
226
  - Add sweep validation to :func:`convert_sweeps_to_list_of_tuples` function.
174
227
 
175
228
 
176
229
  Version 25.11 (2024-10-11)
177
- --------------------------
230
+ ==========================
178
231
 
179
232
  - Add :func:`get_all_common_resonators`
180
233
 
181
234
 
182
235
  Version 25.10 (2024-10-02)
183
- --------------------------
236
+ ==========================
184
237
 
185
238
  - Bump `iqm-data-definitions` to 2.0.
186
239
 
187
240
 
188
241
  Version 25.9 (2024-09-23)
189
- -------------------------
242
+ =========================
190
243
 
191
244
  - Bump dependency `requests` to version 2.32.3
192
245
 
193
246
 
194
247
  Version 25.8 (2024-09-10)
195
- -------------------------
248
+ =========================
196
249
 
197
250
  Features
198
251
  --------
@@ -201,7 +254,7 @@ Features
201
254
 
202
255
 
203
256
  Version 25.7 (2024-08-23)
204
- -------------------------
257
+ =========================
205
258
 
206
259
  Bug fix
207
260
  -------
@@ -209,7 +262,7 @@ Bug fix
209
262
 
210
263
 
211
264
  Version 25.6 (2024-08-16)
212
- -------------------------
265
+ =========================
213
266
 
214
267
  Bug fix
215
268
  -------
@@ -218,7 +271,7 @@ Bug fix
218
271
 
219
272
 
220
273
  Version 25.5 (2024-08-15)
221
- -------------------------
274
+ =========================
222
275
 
223
276
  Features
224
277
  --------
@@ -229,7 +282,7 @@ Features
229
282
 
230
283
 
231
284
  Version 25.4 (2024-07-12)
232
- -------------------------
285
+ =========================
233
286
 
234
287
  Features
235
288
  --------
@@ -238,7 +291,7 @@ Features
238
291
 
239
292
 
240
293
  Version 25.3 (2024-07-05)
241
- -------------------------
294
+ =========================
242
295
 
243
296
  Features
244
297
  --------
@@ -249,7 +302,7 @@ Features
249
302
 
250
303
 
251
304
  Version 25.2 (2024-07-04)
252
- -------------------------
305
+ =========================
253
306
 
254
307
  Features
255
308
  --------
@@ -258,7 +311,7 @@ Features
258
311
 
259
312
 
260
313
  Version 25.1 (2024-06-27)
261
- -------------------------
314
+ =========================
262
315
 
263
316
  Features
264
317
  --------
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-exa-common
3
- Version: 25.33
3
+ Version: 26.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
@@ -215,7 +215,7 @@ Description-Content-Type: text/x-rst
215
215
  License-File: LICENSE.txt
216
216
  Requires-Dist: iqm-data-definitions<3.0,>=2.6
217
217
  Requires-Dist: numpy<3.0,>=1.25.2
218
- Requires-Dist: pydantic<3.0,>=2.9.2
218
+ Requires-Dist: pydantic<3.0,>=2.10.4
219
219
  Requires-Dist: python-dotenv==0.21.1
220
220
  Requires-Dist: xarray==2024.10.0
221
221
  Requires-Dist: requests==2.32.3
@@ -1,6 +1,6 @@
1
1
  iqm-data-definitions >= 2.6, < 3.0
2
2
  numpy >= 1.25.2, < 3.0
3
- pydantic >= 2.9.2, < 3.0
3
+ pydantic >= 2.10.4, < 3.0
4
4
  python-dotenv == 0.21.1
5
5
  xarray == 2024.10.0
6
6
  requests == 2.32.3
@@ -1,6 +1,6 @@
1
1
  iqm-data-definitions >= 2.6, < 3.0
2
2
  numpy >= 1.25.2, < 3.0
3
- pydantic >= 2.9.2, < 3.0
3
+ pydantic >= 2.10.4, < 3.0
4
4
  python-dotenv == 0.21.1
5
5
  xarray == 2024.10.0
6
6
  requests == 2.32.3
@@ -27,13 +27,14 @@ _collection_types_inv = {v: k for k, v in _COLLECTION_TYPES.items()}
27
27
 
28
28
  _DATA_TYPES = {
29
29
  DataType.ANYTHING: ppb.Parameter.DataType.DATA_TYPE_UNSPECIFIED,
30
- DataType.NUMBER: ppb.Parameter.DataType.DATA_TYPE_FLOAT64,
30
+ DataType.NUMBER: ppb.Parameter.DataType.DATA_TYPE_FLOAT64, # Deprecated
31
31
  DataType.STRING: ppb.Parameter.DataType.DATA_TYPE_STRING,
32
32
  DataType.COMPLEX: ppb.Parameter.DataType.DATA_TYPE_COMPLEX128,
33
33
  DataType.BOOLEAN: ppb.Parameter.DataType.DATA_TYPE_BOOL,
34
+ DataType.INT: ppb.Parameter.DataType.DATA_TYPE_INT64,
35
+ DataType.FLOAT: ppb.Parameter.DataType.DATA_TYPE_FLOAT64,
34
36
  }
35
- _data_types_inv = {v: k for k, v in _DATA_TYPES.items()}
36
- _data_types_inv[ppb.Parameter.DataType.DATA_TYPE_INT64] = DataType.NUMBER # TODO add DataType.INT?
37
+ _data_types_inv = {v: k for k, v in _DATA_TYPES.items() if k != DataType.NUMBER}
37
38
 
38
39
 
39
40
  def pack(parameter: Parameter) -> ppb.Parameter:
@@ -18,8 +18,6 @@ import iqm.data_definitions.common.v1.sweep_pb2 as spb
18
18
 
19
19
  from exa.common.api.proto_serialization import sequence
20
20
  import exa.common.api.proto_serialization._parameter as param_proto
21
- from exa.common.control.sweep.fixed_sweep import FixedSweep
22
- from exa.common.control.sweep.option.fixed_options import FixedOptions
23
21
  from exa.common.control.sweep.sweep import Sweep
24
22
  from exa.common.data.parameter import DataType, Parameter
25
23
  from exa.common.sweep.util import NdSweep
@@ -41,10 +39,7 @@ def pack(nd_sweep: NdSweep, minimal: bool = True) -> spb.CartesianSweep:
41
39
 
42
40
 
43
41
  def unpack(proto: spb.CartesianSweep) -> NdSweep:
44
- """Convert protobuf representation into a NdSweep. Reverse operation of :func:`.pack`.
45
-
46
- Note: All sweeps will be of type :class:`.FixedSweep`.
47
- """
42
+ """Convert protobuf representation into a NdSweep. Reverse operation of :func:`.pack`."""
48
43
  nd_sweep = []
49
44
  for parallel_proto in reversed(proto.parallel_sweeps):
50
45
  parallel = tuple(_unpack_single_sweep(sweep) for sweep in parallel_proto.single_parameter_sweeps)
@@ -59,10 +54,10 @@ def _pack_single_sweep(sweep: Sweep, minimal: bool) -> spb.SingleParameterSweep:
59
54
  return spb.SingleParameterSweep(**kwargs)
60
55
 
61
56
 
62
- def _unpack_single_sweep(proto: spb.SingleParameterSweep) -> FixedSweep:
57
+ def _unpack_single_sweep(proto: spb.SingleParameterSweep) -> Sweep:
63
58
  sweep_values = sequence.unpack(proto.values)
64
59
  if proto.HasField("parameter"):
65
60
  parameter = param_proto.unpack(proto.parameter)
66
61
  else:
67
62
  parameter = Parameter(proto.parameter_name, data_type=DataType.ANYTHING)
68
- return FixedSweep(parameter, FixedOptions(sweep_values))
63
+ return Sweep(parameter=parameter, data=sweep_values)
@@ -37,18 +37,18 @@ def pack(values: Sequence) -> dpb.Sequence:
37
37
  if not values:
38
38
  return target
39
39
  dtype = type(values[0])
40
- if dtype == complex: # noqa: E721
40
+ if dtype is complex:
41
41
  target_field = target.complex128_array
42
42
  target_field.real.MergeFrom(np.real(values))
43
43
  target_field.imag.MergeFrom(np.imag(values))
44
44
  return target
45
- if dtype == bool: # noqa: E721
45
+ if dtype is bool:
46
46
  target_field = target.bool_array
47
- elif dtype == int: # noqa: E721
47
+ elif dtype is int:
48
48
  target_field = target.int64_array
49
- elif dtype == float: # noqa: E721
49
+ elif dtype is float:
50
50
  target_field = target.float64_array
51
- elif dtype == str: # noqa: E721
51
+ elif dtype is str:
52
52
  target_field = target.string_array
53
53
  else:
54
54
  raise TypeError(f"Unsupported numpy array type {dtype} for a sequence.")
@@ -0,0 +1,51 @@
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
+ import warnings
19
+
20
+ from exa.common.control.sweep.option import CenterSpanBaseOptions, StartStopBaseOptions
21
+ from exa.common.control.sweep.sweep import Sweep
22
+ from exa.common.data.parameter import Parameter
23
+ from exa.common.errors.exa_error import InvalidSweepOptionsTypeError
24
+
25
+
26
+ class ExponentialSweep(Sweep):
27
+ """Generates parameter values spaced evenly on a geometric progression based on `options`.
28
+
29
+ - If `options` is instance of :class:`.StartStopBaseOptions`,
30
+ the start and stop of the interval are calculated from powers of start and stop.
31
+ - If `options` is instance of :class:`.CenterSpanBaseOptions`,
32
+ the start and stop of the interval are calculated from powers of start and stop,
33
+ which are derived from center and span.
34
+
35
+ Raises:
36
+ ValueError: Error is raised if `options` is inconsistent.
37
+
38
+ """
39
+
40
+ def __init__(
41
+ self,
42
+ parameter: Parameter,
43
+ options: StartStopBaseOptions | CenterSpanBaseOptions | None = None,
44
+ *,
45
+ data: list[Any] | None = None,
46
+ **kwargs,
47
+ ) -> None:
48
+ warnings.warn("ExponentialSweep is deprecated, use Sweep instead.", DeprecationWarning)
49
+ if options and not isinstance(options, StartStopBaseOptions | CenterSpanBaseOptions):
50
+ raise InvalidSweepOptionsTypeError(str(type(options)))
51
+ super().__init__(parameter, options, data=data, **kwargs)
@@ -14,26 +14,22 @@
14
14
 
15
15
  """Sweep specification with arbitrary values."""
16
16
 
17
- from dataclasses import dataclass
18
-
19
- import numpy as np
17
+ from typing import Any
18
+ import warnings
20
19
 
21
20
  from exa.common.control.sweep.option import FixedOptions
22
21
  from exa.common.control.sweep.sweep import Sweep
22
+ from exa.common.data.parameter import Parameter
23
23
  from exa.common.errors.exa_error import InvalidSweepOptionsTypeError
24
24
 
25
25
 
26
- @dataclass(frozen=True)
27
26
  class FixedSweep(Sweep):
28
27
  """A sweep over arbitrary set of values, given by `options`."""
29
28
 
30
- def __post_init__(self):
31
- if not isinstance(self.options, FixedOptions):
32
- raise InvalidSweepOptionsTypeError(str(type(self.options)))
33
-
34
- if not all(self.parameter.validate(value) for value in self.options.fixed):
35
- raise ValueError(
36
- f"Invalid fixed range data {self.options.fixed} for parameter type {self.parameter.data_type.name}."
37
- )
38
- data = np.asarray(self.options.fixed).tolist()
39
- object.__setattr__(self, "_data", data)
29
+ def __init__(
30
+ self, parameter: Parameter, options: FixedOptions | None = None, *, data: list[Any] | None = None, **kwargs
31
+ ) -> None:
32
+ warnings.warn("FixedSweep is deprecated, use Sweep instead.", DeprecationWarning)
33
+ if options and not isinstance(options, FixedOptions):
34
+ raise InvalidSweepOptionsTypeError(str(type(options)))
35
+ super().__init__(parameter, options, data=data, **kwargs)
@@ -0,0 +1,49 @@
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
+ import warnings
19
+
20
+ from exa.common.control.sweep.option import CenterSpanOptions, StartStopOptions
21
+ from exa.common.control.sweep.sweep import Sweep
22
+ from exa.common.data.parameter import Parameter
23
+ from exa.common.errors.exa_error import InvalidSweepOptionsTypeError
24
+
25
+
26
+ class LinearSweep(Sweep):
27
+ """Generates evenly spaced parameter values based on `options`.
28
+
29
+ - If `options` is instance of :class:`.StartStopOptions`, then start and stop options are used for interval
30
+ - If `options` is instance of :class:`.CenterSpanOptions`,
31
+ then the start and stop of the interval are calculated from center and span values
32
+
33
+ Raises:
34
+ ValueError: Error is raised if `options` is inconsistent.
35
+
36
+ """
37
+
38
+ def __init__(
39
+ self,
40
+ parameter: Parameter,
41
+ options: StartStopOptions | CenterSpanOptions | None = None,
42
+ *,
43
+ data: list[Any] | None = None,
44
+ **kwargs,
45
+ ) -> None:
46
+ warnings.warn("LinearSweep is deprecated, use Sweep instead.", DeprecationWarning)
47
+ if options and not isinstance(options, StartStopOptions | CenterSpanOptions):
48
+ raise InvalidSweepOptionsTypeError(str(type(options)))
49
+ super().__init__(parameter, options, data=data, **kwargs)
@@ -11,12 +11,12 @@
11
11
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
+
14
15
  """Range specifications for Sweeps."""
15
16
 
16
17
  from .center_span_base_options import CenterSpanBaseOptions
17
18
  from .center_span_options import CenterSpanOptions
18
19
  from .fixed_options import FixedOptions
19
- from .function_options import FunctionOptions
20
20
  from .start_stop_base_options import StartStopBaseOptions
21
21
  from .start_stop_options import StartStopOptions
22
22
  from .sweep_options import SweepOptions
@@ -12,12 +12,12 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- """Range specification used with ExponentialSweep."""
15
+ """Range specification used with exponential sweeps."""
16
16
 
17
17
  from dataclasses import dataclass
18
- from typing import Union
19
18
 
20
19
  from exa.common.control.sweep.option.constants import DEFAULT_BASE, DEFAULT_COUNT
20
+ from exa.common.control.sweep.option.start_stop_base_options import StartStopBaseOptions
21
21
  from exa.common.control.sweep.option.sweep_options import SweepOptions
22
22
 
23
23
 
@@ -32,17 +32,17 @@ class CenterSpanBaseOptions(SweepOptions):
32
32
  """
33
33
 
34
34
  #: Value of interval center for the power.
35
- center: Union[int, float]
35
+ center: int | float
36
36
  #: Size of the interval for the power
37
- span: Union[int, float]
37
+ span: int | float
38
38
  #: Number of values to generate. Default to
39
39
  #: :const:`exa.common.control.sweep.option.constants.DEFAULT_COUNT`.
40
- count: int = None
40
+ count: int | None = None
41
41
  #: Number, that is raised to the power of the range with the center `center` and the size of `span`.
42
42
  # Default to :const:`exa.common.control.sweep.option.constants.DEFAULT_BASE`.
43
- base: Union[int, float] = None
43
+ base: int | float | None = None
44
44
  #: Order of generated values. Default to ascending
45
- asc: bool = None
45
+ asc: bool | None = None
46
46
 
47
47
  def __post_init__(self):
48
48
  if self.count is None:
@@ -51,3 +51,10 @@ class CenterSpanBaseOptions(SweepOptions):
51
51
  object.__setattr__(self, "base", DEFAULT_BASE)
52
52
  if self.asc is None:
53
53
  object.__setattr__(self, "asc", True)
54
+
55
+ @property
56
+ def data(self) -> list[int | float | complex]:
57
+ start = self.center - (self.span / 2)
58
+ stop = self.center + (self.span / 2)
59
+ (start, stop) = (start, stop) if self.asc else (stop, start)
60
+ return StartStopBaseOptions(start, stop, count=self.count, base=self.base).data