iqm-exa-common 27.3.1__tar.gz → 27.4.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 (84) hide show
  1. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/CHANGELOG.rst +20 -6
  2. iqm_exa_common-27.4.1/MANIFEST.in +4 -0
  3. {iqm_exa_common-27.3.1/src/iqm_exa_common.egg-info → iqm_exa_common-27.4.1}/PKG-INFO +3 -3
  4. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/README.rst +1 -1
  5. iqm_exa_common-27.4.1/docs/changelog.rst +8 -0
  6. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/pyproject.toml +4 -5
  7. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/requirements/base.txt +2 -1
  8. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/api/proto_serialization/nd_sweep.py +1 -2
  9. iqm_exa_common-27.4.1/src/exa/common/control/sweep/sweep.py +17 -0
  10. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/data/parameter.py +26 -0
  11. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/errors/station_control_errors.py +13 -1
  12. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/helpers/data_helper.py +4 -9
  13. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/helpers/deprecation.py +1 -1
  14. iqm_exa_common-27.4.1/src/exa/common/py.typed +0 -0
  15. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/qcm_data/chad_model.py +8 -8
  16. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/qcm_data/file_adapter.py +1 -1
  17. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/qcm_data/immutable_base_model.py +1 -1
  18. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/sweep/database_serialization.py +1 -2
  19. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/sweep/util.py +1 -2
  20. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1/src/iqm_exa_common.egg-info}/PKG-INFO +3 -3
  21. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/iqm_exa_common.egg-info/SOURCES.txt +1 -0
  22. iqm_exa_common-27.4.1/version.txt +1 -0
  23. iqm_exa_common-27.3.1/MANIFEST.in +0 -10
  24. iqm_exa_common-27.3.1/docs/changelog.rst +0 -2
  25. iqm_exa_common-27.3.1/src/exa/common/control/sweep/sweep.py +0 -54
  26. iqm_exa_common-27.3.1/version.txt +0 -1
  27. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/LICENSE.txt +0 -0
  28. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/docs/API.rst +0 -0
  29. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/docs/Makefile +0 -0
  30. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/docs/_static/.gitignore +0 -0
  31. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/docs/_static/css/custom.css +0 -0
  32. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/docs/_static/images/favicon.ico +0 -0
  33. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/docs/_static/images/logo.png +0 -0
  34. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/docs/_templates/autosummary-class-template.rst +0 -0
  35. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/docs/_templates/autosummary-module-template.rst +0 -0
  36. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/docs/conf.py +0 -0
  37. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/docs/index.rst +0 -0
  38. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/docs/license.rst +0 -0
  39. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/requirements/base.in +0 -0
  40. /iqm_exa_common-27.3.1/src/exa/common/py.typed → /iqm_exa_common-27.4.1/requirements/base.in.internal +0 -0
  41. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/setup.cfg +0 -0
  42. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/setup.py +0 -0
  43. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/__init__.py +0 -0
  44. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/api/__init__.py +0 -0
  45. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/api/proto_serialization/__init__.py +0 -0
  46. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/api/proto_serialization/_parameter.py +0 -0
  47. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/api/proto_serialization/array.py +0 -0
  48. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/api/proto_serialization/datum.py +0 -0
  49. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/api/proto_serialization/sequence.py +0 -0
  50. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/api/proto_serialization/setting_node.py +0 -0
  51. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/control/__init__.py +0 -0
  52. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/control/sweep/__init__.py +0 -0
  53. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/control/sweep/option/__init__.py +0 -0
  54. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/control/sweep/option/center_span_base_options.py +0 -0
  55. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/control/sweep/option/center_span_options.py +0 -0
  56. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/control/sweep/option/constants.py +0 -0
  57. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/control/sweep/option/fixed_options.py +0 -0
  58. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/control/sweep/option/option_converter.py +0 -0
  59. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/control/sweep/option/start_stop_base_options.py +0 -0
  60. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/control/sweep/option/start_stop_options.py +0 -0
  61. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/control/sweep/option/sweep_options.py +0 -0
  62. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/control/sweep/sweep_values.py +0 -0
  63. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/data/__init__.py +0 -0
  64. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/data/base_model.py +0 -0
  65. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/data/setting_node.py +0 -0
  66. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/data/settingnode_v2.html.jinja2 +0 -0
  67. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/data/value.py +0 -0
  68. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/errors/__init__.py +0 -0
  69. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/errors/exa_error.py +0 -0
  70. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/helpers/__init__.py +0 -0
  71. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/helpers/json_helper.py +0 -0
  72. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/helpers/numpy_helper.py +0 -0
  73. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/helpers/software_version_helper.py +0 -0
  74. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/helpers/yaml_helper.py +0 -0
  75. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/logger/__init__.py +0 -0
  76. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/logger/logger.py +0 -0
  77. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/qcm_data/__init__.py +0 -0
  78. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/qcm_data/chip_layout.py +0 -0
  79. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/qcm_data/chip_topology.py +0 -0
  80. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/qcm_data/qcm_data_client.py +0 -0
  81. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/exa/common/sweep/__init__.py +0 -0
  82. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/iqm_exa_common.egg-info/dependency_links.txt +0 -0
  83. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/iqm_exa_common.egg-info/requires.txt +0 -0
  84. {iqm_exa_common-27.3.1 → iqm_exa_common-27.4.1}/src/iqm_exa_common.egg-info/top_level.txt +0 -0
@@ -1,11 +1,25 @@
1
- =========
2
- Changelog
3
- =========
1
+ Version 27.4.1 (2025-12-02)
2
+ ===========================
3
+
4
+ Bug fixes
5
+ ---------
6
+
7
+ - Fix version ranges in python package dependencies.
4
8
 
5
- Version 27.3.1 (2025-10-27)
9
+ Version 27.4.0 (2025-11-19)
6
10
  ===========================
7
11
 
8
- - Bump version for 4.3.1 release. No functional changes.
12
+ Features
13
+ --------
14
+
15
+ - Add new error types ``PayloadTooLargeError`` and ``TooManyRequestsError`` used by IQMServer in REST API responses.
16
+ - Add a shortcut ``Setting.sweep(values)`` to create a ``Sweep``.
17
+
18
+ Bug fixes
19
+ ---------
20
+
21
+ - When adding a DataArray with the name of an existing DataArray to a dataset using :func:``add_data_array``,
22
+ update the attributes of the DataArray itself.
9
23
 
10
24
  Version 27.3.0 (2025-10-06)
11
25
  ===========================
@@ -238,7 +252,7 @@ Version 26.10.0 (2025-04-07)
238
252
  Features
239
253
  --------
240
254
 
241
- - Fix package version in published docs footers, :issue:`SW-1392`.
255
+ - Fix package version in published docs footers, :issue:`SW-1392`.
242
256
 
243
257
  Version 26.9.0 (2025-04-03)
244
258
  ===========================
@@ -0,0 +1,4 @@
1
+ include version.txt
2
+ include LICENSE.txt
3
+ prune tests/*
4
+ exclude .gitlab-ci.yml
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-exa-common
3
- Version: 27.3.1
3
+ Version: 27.4.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
@@ -204,7 +204,7 @@ License: Apache License
204
204
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
205
205
  See the License for the specific language governing permissions and
206
206
  limitations under the License.
207
- Project-URL: Documentation, https://iqm-finland.github.io/docs/iqm-exa-common/
207
+ Project-URL: Documentation, https://docs.meetiqm.com/iqm-exa-common/
208
208
  Project-URL: Homepage, https://pypi.org/project/iqm-exa-common/
209
209
  Classifier: Development Status :: 4 - Beta
210
210
  Classifier: Programming Language :: Python :: 3 :: Only
@@ -231,7 +231,7 @@ EXA-common
231
231
 
232
232
  A Python-based project with abstract interfaces, helpers, etc. that are used both in backend and experiment layers.
233
233
 
234
- See `API documentation <https://iqm-finland.github.io/docs/iqm-exa-common/>`_.
234
+ See `API documentation <https://docs.meetiqm.com/iqm-exa-common/>`_.
235
235
 
236
236
  Copyright
237
237
  ---------
@@ -3,7 +3,7 @@ EXA-common
3
3
 
4
4
  A Python-based project with abstract interfaces, helpers, etc. that are used both in backend and experiment layers.
5
5
 
6
- See `API documentation <https://iqm-finland.github.io/docs/iqm-exa-common/>`_.
6
+ See `API documentation <https://docs.meetiqm.com/iqm-exa-common/>`_.
7
7
 
8
8
  Copyright
9
9
  ---------
@@ -0,0 +1,8 @@
1
+ .. _changelog:
2
+
3
+ =========
4
+ CHANGELOG
5
+ =========
6
+
7
+ .. include:: ../CHANGELOG.rst
8
+ :literal:
@@ -1,4 +1,3 @@
1
- # This file is managed by monotool.py, do not edit by hand
2
1
  [build-system]
3
2
  build-backend = "setuptools.build_meta"
4
3
  requires = [ "setuptools", "setuptools_scm[toml]",]
@@ -18,7 +17,7 @@ email = "info@meetiqm.com"
18
17
  file = "LICENSE.txt"
19
18
 
20
19
  [project.urls]
21
- Documentation = "https://iqm-finland.github.io/docs/iqm-exa-common/"
20
+ Documentation = "https://docs.meetiqm.com/iqm-exa-common/"
22
21
  Homepage = "https://pypi.org/project/iqm-exa-common/"
23
22
 
24
23
  [tool.mypy]
@@ -57,7 +56,7 @@ nb_diff_ignore = [ "/metadata/language_info", "/metadata/widgets", "/cells/*/exe
57
56
 
58
57
  [tool.ruff.lint]
59
58
  ignore = [ "D203", "D213",]
60
- select = [ "E4", "E7", "E9", "E5", "F", "Q", "PL", "I", "D", "UP007", "UP006", "UP035", "ANN001", "ANN201", "ANN202",]
59
+ select = [ "E4", "E7", "E9", "E5", "F", "Q", "PL", "I", "D", "UP007", "UP006", "UP035", "ANN001", "ANN201", "ANN202", "NPY201",]
61
60
  unfixable = [ "F401",]
62
61
 
63
62
  [tool.ruff.lint.isort]
@@ -68,10 +67,10 @@ known-third-party = [ "exa", "iqm",]
68
67
  relative-imports-order = "closest-to-furthest"
69
68
 
70
69
  [tool.ruff.lint.per-file-ignores]
71
- "**/__init__.py" = [ "F401", "PLR0402",]
70
+ "**/__init__.py" = [ "D104", "F401", "PLR0402",]
72
71
  "**/docs/*" = [ "E402", "D100",]
73
72
  "**/setup.py" = [ "D100", "D103", "I001", "ANN201",]
74
- "**/src/*" = [ "PLR2004", "D400", "D415", "D205", "D401", "D417", "D100", "D101", "D107", "D102", "D105", "D103", "D404", "D104",]
73
+ "**/src/*" = [ "PLR2004", "D400", "D415", "D205", "D401", "D417", "D100", "D107", "D105", "D102", "D404",]
75
74
  "**/tests/*" = [ "F632", "PLR2004", "PLR0402", "PLC0414", "D", "ANN001", "ANN201", "ANN202",]
76
75
 
77
76
  [tool.ruff.lint.pylint]
@@ -9,4 +9,5 @@ ruamel-yaml==0.17.32
9
9
  ruamel-yaml-clib==0.2.8
10
10
  jinja2 == 3.0.3
11
11
  six==1.16.0
12
- types-six
12
+ types-six
13
+
@@ -20,8 +20,7 @@ from iqm.data_definitions.common.v1.sweep_pb2 import SingleParameterSweep as spb
20
20
 
21
21
  from exa.common.api.proto_serialization import sequence
22
22
  import exa.common.api.proto_serialization._parameter as param_proto
23
- from exa.common.control.sweep.sweep import Sweep
24
- from exa.common.data.parameter import DataType, Parameter
23
+ from exa.common.data.parameter import DataType, Parameter, Sweep
25
24
  from exa.common.sweep.util import NdSweep
26
25
 
27
26
 
@@ -0,0 +1,17 @@
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
+ """Deprecated import path for :class:`.Sweep`."""
16
+
17
+ from ...data.parameter import Sweep # noqa: F401 # Reimport for backwards compatibility
@@ -600,3 +600,29 @@ class Setting(BaseModel):
600
600
  def with_path_name(self) -> Setting:
601
601
  """Copy of self with the parameter name replaced by the path name."""
602
602
  return self.model_copy(update={"parameter": self.parameter.model_copy(update={"name": self.path})})
603
+
604
+ def sweep(self, values: SweepValues) -> Sweep:
605
+ """Create a Sweep object that represents a 1d scan of this setting over the given values.
606
+
607
+ Args:
608
+ values: Sweep values.
609
+
610
+ Returns:
611
+ The Sweep object.
612
+
613
+ """
614
+ return Sweep(parameter=self.parameter, data=values)
615
+
616
+
617
+ class Sweep(BaseModel):
618
+ """Base immutable class for sweeps."""
619
+
620
+ parameter: Parameter
621
+ """The Sweep represents changing the values of this Parameter."""
622
+
623
+ data: SweepValues
624
+ """List of values for :attr:`parameter`"""
625
+
626
+ def model_post_init(self, __context: Any) -> None:
627
+ if not all(self.parameter.validate(value) for value in self.data):
628
+ raise ValueError(f"Invalid range data {self.data} for parameter type {self.parameter.data_type}.")
@@ -64,10 +64,18 @@ class ConflictError(StationControlError):
64
64
  """
65
65
 
66
66
 
67
+ class PayloadTooLargeError(StationControlError):
68
+ """This error happens when the request payload is too large."""
69
+
70
+
67
71
  class ValidationError(StationControlError):
68
72
  """Error raised when something is unprocessable in general, for example if the input value is not acceptable."""
69
73
 
70
74
 
75
+ class TooManyRequestsError(StationControlError):
76
+ """Error raised when the user has sent too many requests in a given amount of time ("rate limiting")."""
77
+
78
+
71
79
  class InternalServerError(StationControlError):
72
80
  """Error raised when an unexpected error happened on the server side.
73
81
 
@@ -94,7 +102,9 @@ _ERROR_TO_STATUS_CODE_MAPPING = {
94
102
  ForbiddenError: HTTPStatus.FORBIDDEN, # 403
95
103
  NotFoundError: HTTPStatus.NOT_FOUND, # 404
96
104
  ConflictError: HTTPStatus.CONFLICT, # 409
105
+ PayloadTooLargeError: HTTPStatus.REQUEST_ENTITY_TOO_LARGE, # 413
97
106
  ValidationError: HTTPStatus.UNPROCESSABLE_ENTITY, # 422
107
+ TooManyRequestsError: HTTPStatus.TOO_MANY_REQUESTS, # 429
98
108
  InternalServerError: HTTPStatus.INTERNAL_SERVER_ERROR, # 500
99
109
  BadGatewayError: HTTPStatus.BAD_GATEWAY, # 502
100
110
  ServiceUnavailableError: HTTPStatus.SERVICE_UNAVAILABLE, # 503
@@ -115,6 +125,8 @@ def map_from_error_to_status_code(error: StationControlError) -> HTTPStatus:
115
125
  return HTTPStatus.INTERNAL_SERVER_ERROR
116
126
 
117
127
 
118
- def map_from_status_code_to_error(status_code: HTTPStatus) -> type[StationControlError]:
128
+ def map_from_status_code_to_error(status_code: HTTPStatus | int) -> type[StationControlError]:
119
129
  """Map an HTTPStatus code to a StationControlError."""
130
+ if isinstance(status_code, int):
131
+ status_code = HTTPStatus(status_code)
120
132
  return _STATUS_CODE_TO_ERROR_MAPPING.get(status_code, InternalServerError)
@@ -24,7 +24,7 @@ import xarray as xr
24
24
  def add_data_array(ds: xr.Dataset, da: xr.DataArray, name: Hashable | None = None) -> xr.Dataset:
25
25
  """Add data array `da` to dataset `ds`.
26
26
 
27
- Unlike the default xarray command, preserves metadata of the dataset.
27
+ Unlike the default xarray command, preserves metadata of the coordinates.
28
28
 
29
29
  Args:
30
30
  ds: Dataset to add to.
@@ -44,16 +44,11 @@ def add_data_array(ds: xr.Dataset, da: xr.DataArray, name: Hashable | None = Non
44
44
  # Attributes of Dataset coordinates are dropped/replaced when adding a DataArray
45
45
  # https://github.com/pydata/xarray/issues/2245
46
46
  # So we need to temporarily store all coord attrs, and then add them back
47
- attributes = {}
48
- for key in ds.coords:
49
- attributes[key] = ds.coords[key].attrs
50
- for key in ds.data_vars:
51
- attributes[key] = ds.data_vars[key].attrs
47
+ attributes = {key: value.attrs for key, value in ds.coords.items()}
48
+
52
49
  ds[name] = da
53
50
  for key in ds.coords:
54
51
  if attributes.get(key):
55
52
  ds.coords[key].attrs = attributes.get(key) # type:ignore[assignment]
56
- for key in ds.data_vars:
57
- if attributes.get(key):
58
- ds.data_vars[key].attrs = attributes[key]
53
+
59
54
  return ds
@@ -11,7 +11,7 @@ def _assert_iso_8601_format(since: str) -> None:
11
11
  raise ValueError("Invalid date format. Use 'YYYY-MM-DD'.")
12
12
 
13
13
 
14
- def format_deprecated(old: str, new: str | None, since: str) -> LiteralString:
14
+ def format_deprecated(old: str, new: str | None, since: str) -> LiteralString: # noqa: D103
15
15
  _assert_iso_8601_format(since)
16
16
  message: str = (
17
17
  f"{old} is deprecated since {since}, it can be be removed from the codebase in the next major release."
File without changes
@@ -28,7 +28,7 @@ def _natural_sort_key(name: str) -> tuple[int | str | Any, ...]:
28
28
  return tuple(int(item) if item.isdigit() else item.lower() for item in re.split(r"(\d+)", name))
29
29
 
30
30
 
31
- class Component(ImmutableBaseModel):
31
+ class Component(ImmutableBaseModel): # noqa: D101
32
32
  name: str
33
33
  connections: tuple[str, ...] = ()
34
34
 
@@ -41,28 +41,28 @@ class Component(ImmutableBaseModel):
41
41
  return tuple(sorted(connections, key=_natural_sort_key))
42
42
 
43
43
 
44
- class Qubit(Component):
44
+ class Qubit(Component): # noqa: D101
45
45
  pass
46
46
 
47
47
 
48
- class Coupler(Component):
48
+ class Coupler(Component): # noqa: D101
49
49
  pass
50
50
 
51
51
 
52
- class ProbeLine(Component):
52
+ class ProbeLine(Component): # noqa: D101
53
53
  pass
54
54
 
55
55
 
56
- class Launcher(Component):
56
+ class Launcher(Component): # noqa: D101
57
57
  pin: str
58
58
  function: str
59
59
 
60
60
 
61
- class ComputationalResonator(Component):
61
+ class ComputationalResonator(Component): # noqa: D101
62
62
  pass
63
63
 
64
64
 
65
- class Components(ImmutableBaseModel):
65
+ class Components(ImmutableBaseModel): # noqa: D101
66
66
  # Alias list of components to plurals rather than singulars to follow normal naming conventions
67
67
  qubits: tuple[Qubit, ...] = Field((), alias="qubit")
68
68
  couplers: tuple[Coupler, ...] = Field((), alias="tunable_coupler")
@@ -83,7 +83,7 @@ class Components(ImmutableBaseModel):
83
83
  return {component.name: component for component in components}
84
84
 
85
85
 
86
- class CHAD(ImmutableBaseModel):
86
+ class CHAD(ImmutableBaseModel): # noqa: D101
87
87
  mask_set_name: str
88
88
  variant: str
89
89
  components: Components
@@ -25,7 +25,7 @@ from requests.adapters import BaseAdapter
25
25
  from six import BytesIO
26
26
 
27
27
 
28
- class FileAdapter(BaseAdapter):
28
+ class FileAdapter(BaseAdapter): # noqa: D101
29
29
  def __init__(self, set_content_length=True): # noqa: ANN001
30
30
  super(FileAdapter, self).__init__()
31
31
  self._set_content_length = set_content_length
@@ -18,7 +18,7 @@ from pydantic import BaseModel, ConfigDict
18
18
 
19
19
 
20
20
  # Change the behaviour of pydantic globally
21
- class ImmutableBaseModel(BaseModel):
21
+ class ImmutableBaseModel(BaseModel): # noqa: D101
22
22
  # Unable to use cached_property
23
23
  # https://github.com/pydantic/pydantic/issues/1241
24
24
  model_config = ConfigDict(frozen=True, ignored_types=(cached_property,))
@@ -20,8 +20,7 @@ serializing and deserializing sweep arguments before saving them to database.
20
20
  import json
21
21
  from typing import Any, cast
22
22
 
23
- from exa.common.control.sweep.sweep import Sweep
24
- from exa.common.data.parameter import Parameter
23
+ from exa.common.data.parameter import Parameter, Sweep
25
24
  from exa.common.data.setting_node import SettingNode
26
25
  from exa.common.helpers import json_helper
27
26
  from exa.common.helpers.json_helper import decode_json, get_json_encoder
@@ -17,8 +17,7 @@ user-friendly format to canonic ones.
17
17
  """
18
18
 
19
19
  from exa.common.control.sweep.option import StartStopOptions
20
- from exa.common.control.sweep.sweep import Sweep
21
- from exa.common.data.parameter import Parameter
20
+ from exa.common.data.parameter import Parameter, Sweep
22
21
 
23
22
  # One sweep where many sweeps are executed together, like a zip. Type hint alias.
24
23
  ParallelSweep = tuple[Sweep, ...]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-exa-common
3
- Version: 27.3.1
3
+ Version: 27.4.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
@@ -204,7 +204,7 @@ License: Apache License
204
204
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
205
205
  See the License for the specific language governing permissions and
206
206
  limitations under the License.
207
- Project-URL: Documentation, https://iqm-finland.github.io/docs/iqm-exa-common/
207
+ Project-URL: Documentation, https://docs.meetiqm.com/iqm-exa-common/
208
208
  Project-URL: Homepage, https://pypi.org/project/iqm-exa-common/
209
209
  Classifier: Development Status :: 4 - Beta
210
210
  Classifier: Programming Language :: Python :: 3 :: Only
@@ -231,7 +231,7 @@ EXA-common
231
231
 
232
232
  A Python-based project with abstract interfaces, helpers, etc. that are used both in backend and experiment layers.
233
233
 
234
- See `API documentation <https://iqm-finland.github.io/docs/iqm-exa-common/>`_.
234
+ See `API documentation <https://docs.meetiqm.com/iqm-exa-common/>`_.
235
235
 
236
236
  Copyright
237
237
  ---------
@@ -18,6 +18,7 @@ docs/_static/images/logo.png
18
18
  docs/_templates/autosummary-class-template.rst
19
19
  docs/_templates/autosummary-module-template.rst
20
20
  requirements/base.in
21
+ requirements/base.in.internal
21
22
  requirements/base.txt
22
23
  src/exa/common/__init__.py
23
24
  src/exa/common/py.typed
@@ -0,0 +1 @@
1
+ 27.4.1
@@ -1,10 +0,0 @@
1
- include CHANGELOG.rst
2
- include version.txt
3
- prune changelog/
4
- prune tests/*
5
- exclude docbuild
6
- exclude format
7
- exclude lint
8
- exclude sub-pyproject.toml
9
- exclude test
10
- exclude .gitlab-ci.yml
@@ -1,2 +0,0 @@
1
- .. _changes:
2
- .. include:: ../CHANGELOG.rst
@@ -1,54 +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
- """Base immutable class for sweeps specifications."""
16
-
17
- from typing import Any
18
-
19
- from exa.common.control.sweep.option import CenterSpanOptions, StartStopOptions
20
- from exa.common.control.sweep.sweep_values import SweepValues
21
- from exa.common.data.base_model import BaseModel
22
- from exa.common.data.parameter import Parameter
23
-
24
-
25
- class Sweep(BaseModel):
26
- """Base immutable class for sweeps."""
27
-
28
- parameter: Parameter
29
- """The Sweep represents changing the values of this Parameter."""
30
-
31
- data: SweepValues
32
- """List of values for :attr:`parameter`"""
33
-
34
- def model_post_init(self, __context: Any) -> None:
35
- if not all(self.parameter.validate(value) for value in self.data):
36
- raise ValueError(f"Invalid range data {self.data} for parameter type {self.parameter.data_type}.")
37
-
38
- @classmethod
39
- def __from_center_span(cls, parameter: Parameter, options: CenterSpanOptions) -> SweepValues:
40
- cls._validate_value(parameter, options.center, "center")
41
- cls._validate_value(parameter, options.span, "span")
42
- return options.data
43
-
44
- @classmethod
45
- def __from_start_stop(cls, parameter: Parameter, options: StartStopOptions) -> SweepValues:
46
- cls._validate_value(parameter, options.start, "start")
47
- cls._validate_value(parameter, options.stop, "stop")
48
- cls._validate_value(parameter, options.step, "step") # type: ignore[arg-type]
49
- return options.data
50
-
51
- @staticmethod
52
- def _validate_value(parameter: Parameter, value: complex | str | bool, value_label: str) -> None:
53
- if not parameter.validate(value):
54
- raise ValueError(f"Invalid {value_label} value {value} for parameter type {parameter.data_type}.")
@@ -1 +0,0 @@
1
- 27.3.1