iqm-exa-common 25.34__tar.gz → 26.1__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.34 → iqm_exa_common-26.1}/CHANGELOG.rst +87 -34
  2. {iqm_exa_common-25.34/src/iqm_exa_common.egg-info → iqm_exa_common-26.1}/PKG-INFO +2 -2
  3. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/requirements/base.in +1 -1
  4. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/requirements/base.txt +1 -1
  5. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/api/proto_serialization/_parameter.py +4 -3
  6. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/api/proto_serialization/nd_sweep.py +3 -8
  7. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/api/proto_serialization/sequence.py +5 -5
  8. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/api/proto_serialization/setting_node.py +3 -1
  9. iqm_exa_common-26.1/src/exa/common/control/sweep/exponential_sweep.py +51 -0
  10. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/control/sweep/fixed_sweep.py +10 -14
  11. iqm_exa_common-26.1/src/exa/common/control/sweep/linear_sweep.py +49 -0
  12. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/control/sweep/option/__init__.py +1 -1
  13. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/control/sweep/option/center_span_base_options.py +14 -7
  14. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/control/sweep/option/center_span_options.py +13 -6
  15. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/control/sweep/option/constants.py +2 -2
  16. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/control/sweep/option/fixed_options.py +8 -2
  17. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/control/sweep/option/option_converter.py +4 -8
  18. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/control/sweep/option/start_stop_base_options.py +20 -6
  19. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/control/sweep/option/start_stop_options.py +20 -5
  20. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/control/sweep/option/sweep_options.py +9 -0
  21. iqm_exa_common-26.1/src/exa/common/control/sweep/sweep.py +80 -0
  22. iqm_exa_common-26.1/src/exa/common/control/sweep/sweep_values.py +58 -0
  23. iqm_exa_common-26.1/src/exa/common/data/base_model.py +40 -0
  24. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/data/parameter.py +123 -68
  25. iqm_exa_common-26.1/src/exa/common/data/setting_node.py +1052 -0
  26. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/data/settingnode_v2.html.jinja2 +6 -6
  27. iqm_exa_common-26.1/src/exa/common/data/value.py +49 -0
  28. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/logger/logger.py +1 -1
  29. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/qcm_data/file_adapter.py +2 -6
  30. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/qcm_data/qcm_data_client.py +1 -37
  31. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/sweep/database_serialization.py +30 -98
  32. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/sweep/util.py +4 -5
  33. {iqm_exa_common-25.34 → iqm_exa_common-26.1/src/iqm_exa_common.egg-info}/PKG-INFO +2 -2
  34. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/iqm_exa_common.egg-info/SOURCES.txt +3 -8
  35. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/iqm_exa_common.egg-info/requires.txt +1 -1
  36. iqm_exa_common-26.1/version.txt +1 -0
  37. iqm_exa_common-25.34/src/exa/common/api/model/__init__.py +0 -15
  38. iqm_exa_common-25.34/src/exa/common/api/model/parameter_model.py +0 -111
  39. iqm_exa_common-25.34/src/exa/common/api/model/setting_model.py +0 -63
  40. iqm_exa_common-25.34/src/exa/common/api/model/setting_node_model.py +0 -72
  41. iqm_exa_common-25.34/src/exa/common/api/model/sweep_model.py +0 -63
  42. iqm_exa_common-25.34/src/exa/common/control/sweep/exponential_sweep.py +0 -83
  43. iqm_exa_common-25.34/src/exa/common/control/sweep/function_sweep.py +0 -35
  44. iqm_exa_common-25.34/src/exa/common/control/sweep/linear_sweep.py +0 -74
  45. iqm_exa_common-25.34/src/exa/common/control/sweep/option/function_options.py +0 -26
  46. iqm_exa_common-25.34/src/exa/common/control/sweep/sweep.py +0 -44
  47. iqm_exa_common-25.34/src/exa/common/control/sweep/utils.py +0 -43
  48. iqm_exa_common-25.34/src/exa/common/data/setting_node.py +0 -706
  49. iqm_exa_common-25.34/version.txt +0 -1
  50. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/LICENSE.txt +0 -0
  51. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/MANIFEST.in +0 -0
  52. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/README.rst +0 -0
  53. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/docs/API.rst +0 -0
  54. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/docs/Makefile +0 -0
  55. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/docs/_static/.gitignore +0 -0
  56. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/docs/_static/css/custom.css +0 -0
  57. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/docs/_static/images/favicon.ico +0 -0
  58. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/docs/_static/images/logo.png +0 -0
  59. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/docs/_templates/autosummary-class-template.rst +0 -0
  60. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/docs/_templates/autosummary-module-template.rst +0 -0
  61. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/docs/changelog.rst +0 -0
  62. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/docs/conf.py +0 -0
  63. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/docs/index.rst +0 -0
  64. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/docs/license.rst +0 -0
  65. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/pyproject.toml +0 -0
  66. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/setup.cfg +0 -0
  67. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/setup.py +0 -0
  68. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/__init__.py +0 -0
  69. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/api/__init__.py +0 -0
  70. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/api/proto_serialization/__init__.py +0 -0
  71. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/api/proto_serialization/array.py +0 -0
  72. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/api/proto_serialization/datum.py +0 -0
  73. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/control/__init__.py +0 -0
  74. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/control/sweep/__init__.py +0 -0
  75. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/data/__init__.py +0 -0
  76. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/errors/__init__.py +0 -0
  77. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/errors/exa_error.py +0 -0
  78. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/helpers/__init__.py +0 -0
  79. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/helpers/data_helper.py +0 -0
  80. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/helpers/json_helper.py +0 -0
  81. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/helpers/numpy_helper.py +0 -0
  82. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/helpers/software_version_helper.py +0 -0
  83. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/logger/__init__.py +0 -0
  84. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/qcm_data/__init__.py +0 -0
  85. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/qcm_data/chad_model.py +0 -0
  86. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/qcm_data/chip_topology.py +0 -0
  87. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/qcm_data/immutable_base_model.py +0 -0
  88. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/exa/common/sweep/__init__.py +0 -0
  89. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/src/iqm_exa_common.egg-info/dependency_links.txt +0 -0
  90. {iqm_exa_common-25.34 → iqm_exa_common-26.1}/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.1 (2025-02-28)
6
+ =========================
7
+
8
+
9
+ Bug fix
10
+ -------
11
+ - Fix protobuf deserialisation to not align SettingNode names
12
+
13
+ Version 26.0 (2025-02-27)
14
+ =========================
15
+
16
+
17
+ Features
18
+ --------
19
+
20
+ Breaking changes
21
+ ****************
22
+
23
+ - Remove Pydantic based ``ParameterModel``, ``SettingModel``, ``SettingNodeModel``, and ``SweepModel``,
24
+ and inherit ``Parameter``, ``Setting``, ``SettingNode``, and ``Sweep`` from Pydantic model directly.
25
+ As a result, the signature of usage has changed. :issue:`SW-798`
26
+ - Instead of ``copy``, ``model_copy`` (with an optional ``update`` parameter) should be used.
27
+ - For deserialization, for now, use :meth:`SettingNode.deserialize` (Pydantic native approach will be implemented later)
28
+ - ``FunctionSweep`` and ``FunctionOptions`` has been deleted.
29
+ - :class:`.SettingNode` now supports "the path notation" when inserting/getting nodes
30
+
31
+ - Example: ``settings["flux.my.new.path.foo"] = SettingNode(...)`` adds the specified node under the specified path.
32
+ Any missing subnodes will be added.
33
+
34
+ - :class:`.SettingNode` and :class:`.Setting` now have an attribute ``path`` which will be populated by their relative
35
+ path within the settings tree when inserting/creating the node. The base class will also automatically align the name
36
+ of a node with its path, but there is an attribute ``align_name`` which can be set to ``False`` to not align
37
+ (used e.g. in the controllers section of the EXA settings tree).
38
+ - Remove deprecated ``QCMClient.get_chad`` and ``QCMClient.get_qubit_design_properties``.
39
+
40
+ Features
41
+ --------
42
+
43
+ - Settings can now be declared read-only by setting ``read_only = True`` when
44
+ initialising the setting.
45
+ - Modified the html representation of settings tree to support read_only settings.
46
+ - Methods :meth:`.SettingNode.get_gate_node_for_locus`, :meth:`.SettingNode.get_gate_properties_for_locus`,
47
+ :meth:`.SettingNode.get_default_implementation`, and :meth:`.SettingNode.get_locus_node_paths_for` added
48
+ for accessing EXA-specific gate/characterization nodes in the settings tree.
49
+ - Methods :meth:`.SettingNode.add_for_path` and :meth:`.get_node_for_path` that facilitate dealing with long paths
50
+ in setting trees.
51
+ in setting trees.
52
+ - ``Sweep.options`` is deprecated, use ``Sweep.data`` instead. ``data`` can be still generated using different
53
+ sweep options.
54
+ - ``ExponentialSweep``, ``FixedSweep``, and ``LinearSweep`` are deprecated, use ``Sweep`` instead.
55
+ - Split ``DataType.NUMBER`` to ``DataType.FLOAT`` and ``DataType.INT``. ``DataType.NUMBER`` is now handled as a
56
+ deprecated alias for ``DataType.FLOAT``.
57
+
5
58
  Version 25.34 (2025-02-06)
6
- --------------------------
59
+ ==========================
7
60
 
8
61
  Bug fixes
9
62
  ---------
@@ -11,7 +64,7 @@ Bug fixes
11
64
  - Bump mechanize test dependency.
12
65
 
13
66
  Version 25.33 (2025-02-04)
14
- --------------------------
67
+ ==========================
15
68
 
16
69
  Features
17
70
  --------
@@ -20,7 +73,7 @@ Features
20
73
 
21
74
 
22
75
  Version 25.32 (2025-02-04)
23
- --------------------------
76
+ ==========================
24
77
 
25
78
  Features
26
79
  --------
@@ -29,14 +82,14 @@ Features
29
82
 
30
83
 
31
84
  Version 25.31 (2025-01-28)
32
- --------------------------
85
+ ==========================
33
86
 
34
87
  Features
35
88
  ********
36
89
  - 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`.
37
90
 
38
91
  Version 25.30 (2025-01-28)
39
- --------------------------
92
+ ==========================
40
93
 
41
94
  Bug Fixes
42
95
  ---------
@@ -45,7 +98,7 @@ Bug Fixes
45
98
  computational resonators.
46
99
 
47
100
  Version 25.29 (2025-01-27)
48
- --------------------------
101
+ ==========================
49
102
 
50
103
  Features
51
104
  --------
@@ -53,7 +106,7 @@ Features
53
106
  - Bump version for an updated repo organization. No functional changes. :issue:`SW-1042`
54
107
 
55
108
  Version 25.28 (2025-01-08)
56
- --------------------------
109
+ ==========================
57
110
 
58
111
  Features
59
112
  --------
@@ -61,14 +114,14 @@ Features
61
114
  - Remove gitlab links from public pages. :issue:`SW-776`
62
115
 
63
116
  Version 25.27 (2024-12-19)
64
- --------------------------
117
+ ==========================
65
118
 
66
119
  Features
67
120
  ********
68
121
  - Bumps xarray
69
122
 
70
123
  Version 25.26 (2024-12-12)
71
- --------------------------
124
+ ==========================
72
125
 
73
126
  Features
74
127
  --------
@@ -76,7 +129,7 @@ Features
76
129
  - Bump exa-experiments
77
130
 
78
131
  Version 25.25 (2024-12-11)
79
- --------------------------
132
+ ==========================
80
133
 
81
134
  Features
82
135
  --------
@@ -84,7 +137,7 @@ Features
84
137
  - Fix public PyPI publishing. :issue:`SW-776`
85
138
 
86
139
  Version 25.24 (2024-12-11)
87
- --------------------------
140
+ ==========================
88
141
 
89
142
  Features
90
143
  --------
@@ -92,7 +145,7 @@ Features
92
145
  - Change license info to Apache 2.0. :issue:`SW-776`
93
146
 
94
147
  Version 25.23 (2024-12-09)
95
- --------------------------
148
+ ==========================
96
149
 
97
150
  Features
98
151
  --------
@@ -100,7 +153,7 @@ Features
100
153
  Fix extlinks to MRs and issues in sphinx docs config :issue:`SW-916`
101
154
 
102
155
  Version 25.22 (2024-12-05)
103
- --------------------------
156
+ ==========================
104
157
 
105
158
  Features
106
159
  --------
@@ -108,14 +161,14 @@ Features
108
161
  - Fix intersphinx reference paths in docs :issue:`SW-916`
109
162
 
110
163
  Version 25.21 (2024-12-04)
111
- --------------------------
164
+ ==========================
112
165
 
113
166
  Test
114
167
  ****
115
168
  - Adds unit test for sorting couplers
116
169
 
117
170
  Version 25.20 (2024-12-04)
118
- --------------------------
171
+ ==========================
119
172
 
120
173
  Features
121
174
  --------
@@ -123,7 +176,7 @@ Features
123
176
  - Bump version for an updated repo organization. No functional changes. :issue:`SW-665`
124
177
 
125
178
  Version 25.19 (2024-11-29)
126
- --------------------------
179
+ ==========================
127
180
 
128
181
  Features
129
182
  --------
@@ -132,7 +185,7 @@ Features
132
185
  gates, required for :issue:`GBC-589`.
133
186
 
134
187
  Version 25.18 (2024-11-27)
135
- --------------------------
188
+ ==========================
136
189
 
137
190
  Features
138
191
  --------
@@ -140,7 +193,7 @@ Features
140
193
  - Expand allowed CHEDDAR versions in `qcm_data_client` to include versions 2.x.
141
194
 
142
195
  Version 25.17 (2024-11-19)
143
- --------------------------
196
+ ==========================
144
197
 
145
198
  Features
146
199
  --------
@@ -148,7 +201,7 @@ Features
148
201
  - Bump version for an updated repo organization. No functional changes. :issue:`SW-774`
149
202
 
150
203
  Version 25.16 (2024-11-15)
151
- --------------------------
204
+ ==========================
152
205
 
153
206
  Bug fixes
154
207
  ---------
@@ -156,7 +209,7 @@ Bug fixes
156
209
  - Remove iqm-internal web links in customer docs artifacts.
157
210
 
158
211
  Version 25.15 (2024-11-08)
159
- --------------------------
212
+ ==========================
160
213
 
161
214
  Features
162
215
  --------
@@ -164,43 +217,43 @@ Features
164
217
  - New changelog workflow, no functional changes. :issue:`SW-774`
165
218
 
166
219
  Version 25.14 (2024-10-30)
167
- --------------------------
220
+ ==========================
168
221
 
169
222
  - Bump Pydantic to version 2.9.2, :issue:`SW-804`.
170
223
 
171
224
 
172
225
  Version 25.13 (2024-10-28)
173
- --------------------------
226
+ ==========================
174
227
 
175
228
  - Bump NumPy to version 1.25.2.
176
229
 
177
230
 
178
231
  Version 25.12 (2024-10-24)
179
- --------------------------
232
+ ==========================
180
233
 
181
234
  - Add sweep validation to :func:`convert_sweeps_to_list_of_tuples` function.
182
235
 
183
236
 
184
237
  Version 25.11 (2024-10-11)
185
- --------------------------
238
+ ==========================
186
239
 
187
240
  - Add :func:`get_all_common_resonators`
188
241
 
189
242
 
190
243
  Version 25.10 (2024-10-02)
191
- --------------------------
244
+ ==========================
192
245
 
193
246
  - Bump `iqm-data-definitions` to 2.0.
194
247
 
195
248
 
196
249
  Version 25.9 (2024-09-23)
197
- -------------------------
250
+ =========================
198
251
 
199
252
  - Bump dependency `requests` to version 2.32.3
200
253
 
201
254
 
202
255
  Version 25.8 (2024-09-10)
203
- -------------------------
256
+ =========================
204
257
 
205
258
  Features
206
259
  --------
@@ -209,7 +262,7 @@ Features
209
262
 
210
263
 
211
264
  Version 25.7 (2024-08-23)
212
- -------------------------
265
+ =========================
213
266
 
214
267
  Bug fix
215
268
  -------
@@ -217,7 +270,7 @@ Bug fix
217
270
 
218
271
 
219
272
  Version 25.6 (2024-08-16)
220
- -------------------------
273
+ =========================
221
274
 
222
275
  Bug fix
223
276
  -------
@@ -226,7 +279,7 @@ Bug fix
226
279
 
227
280
 
228
281
  Version 25.5 (2024-08-15)
229
- -------------------------
282
+ =========================
230
283
 
231
284
  Features
232
285
  --------
@@ -237,7 +290,7 @@ Features
237
290
 
238
291
 
239
292
  Version 25.4 (2024-07-12)
240
- -------------------------
293
+ =========================
241
294
 
242
295
  Features
243
296
  --------
@@ -246,7 +299,7 @@ Features
246
299
 
247
300
 
248
301
  Version 25.3 (2024-07-05)
249
- -------------------------
302
+ =========================
250
303
 
251
304
  Features
252
305
  --------
@@ -257,7 +310,7 @@ Features
257
310
 
258
311
 
259
312
  Version 25.2 (2024-07-04)
260
- -------------------------
313
+ =========================
261
314
 
262
315
  Features
263
316
  --------
@@ -266,7 +319,7 @@ Features
266
319
 
267
320
 
268
321
  Version 25.1 (2024-06-27)
269
- -------------------------
322
+ =========================
270
323
 
271
324
  Features
272
325
  --------
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-exa-common
3
- Version: 25.34
3
+ Version: 26.1
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.")
@@ -85,4 +85,6 @@ def unpack(proto: spb.SettingNode) -> SettingNode:
85
85
  """
86
86
  settings = {key: _unpack_setting(content) for key, content in proto.settings.items()}
87
87
  nodes = {key: unpack(content) for key, content in proto.subnodes.items()}
88
- return SettingNode(name=proto.name, **(settings | nodes))
88
+ # Names are currently NEVER aligned with the paths when deserializing. This is safe to do, since currently nothing
89
+ # in the server-side assumes path==name, but if such logic is added this needs to be reconsidered.
90
+ return SettingNode(name=proto.name, **(settings | nodes), align_name=False)
@@ -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