iqm-exa-common 25.31__tar.gz → 25.33__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 (83) hide show
  1. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/CHANGELOG.rst +18 -0
  2. {iqm_exa_common-25.31/src/iqm_exa_common.egg-info → iqm_exa_common-25.33}/PKG-INFO +1 -1
  3. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/pyproject.toml +29 -43
  4. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/setup.py +6 -1
  5. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/__init__.py +1 -0
  6. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/api/model/parameter_model.py +2 -3
  7. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/api/model/setting_model.py +2 -3
  8. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/api/model/setting_node_model.py +2 -3
  9. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/api/model/sweep_model.py +1 -0
  10. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/api/proto_serialization/_parameter.py +1 -3
  11. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/api/proto_serialization/array.py +2 -1
  12. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/api/proto_serialization/datum.py +5 -3
  13. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/api/proto_serialization/nd_sweep.py +1 -2
  14. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/api/proto_serialization/sequence.py +7 -6
  15. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/api/proto_serialization/setting_node.py +3 -2
  16. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/exponential_sweep.py +2 -0
  17. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/fixed_sweep.py +1 -0
  18. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/function_sweep.py +1 -0
  19. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/linear_sweep.py +2 -0
  20. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/option/center_span_base_options.py +1 -0
  21. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/option/center_span_options.py +1 -0
  22. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/option/constants.py +1 -0
  23. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/option/fixed_options.py +1 -0
  24. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/option/option_converter.py +2 -0
  25. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/option/start_stop_base_options.py +1 -0
  26. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/option/start_stop_options.py +1 -0
  27. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/sweep.py +1 -0
  28. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/data/parameter.py +7 -1
  29. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/data/setting_node.py +21 -13
  30. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/errors/exa_error.py +1 -0
  31. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/helpers/data_helper.py +1 -0
  32. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/helpers/numpy_helper.py +1 -0
  33. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/helpers/software_version_helper.py +3 -2
  34. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/logger/__init__.py +1 -0
  35. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/logger/logger.py +5 -5
  36. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/qcm_data/chad_model.py +5 -0
  37. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/qcm_data/chip_topology.py +21 -6
  38. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/qcm_data/qcm_data_client.py +3 -1
  39. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/sweep/database_serialization.py +12 -4
  40. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/sweep/util.py +3 -0
  41. {iqm_exa_common-25.31 → iqm_exa_common-25.33/src/iqm_exa_common.egg-info}/PKG-INFO +1 -1
  42. iqm_exa_common-25.33/version.txt +1 -0
  43. iqm_exa_common-25.31/version.txt +0 -1
  44. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/LICENSE.txt +0 -0
  45. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/MANIFEST.in +0 -0
  46. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/README.rst +0 -0
  47. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/docs/API.rst +0 -0
  48. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/docs/Makefile +0 -0
  49. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/docs/_static/.gitignore +0 -0
  50. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/docs/_static/css/custom.css +0 -0
  51. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/docs/_static/images/favicon.ico +0 -0
  52. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/docs/_static/images/logo.png +0 -0
  53. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/docs/_templates/autosummary-class-template.rst +0 -0
  54. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/docs/_templates/autosummary-module-template.rst +0 -0
  55. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/docs/changelog.rst +0 -0
  56. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/docs/conf.py +0 -0
  57. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/docs/index.rst +0 -0
  58. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/docs/license.rst +0 -0
  59. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/requirements/base.in +0 -0
  60. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/requirements/base.txt +0 -0
  61. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/setup.cfg +0 -0
  62. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/api/__init__.py +0 -0
  63. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/api/model/__init__.py +0 -0
  64. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/api/proto_serialization/__init__.py +0 -0
  65. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/__init__.py +0 -0
  66. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/__init__.py +0 -0
  67. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/option/__init__.py +0 -0
  68. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/option/function_options.py +0 -0
  69. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/option/sweep_options.py +0 -0
  70. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/control/sweep/utils.py +0 -0
  71. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/data/__init__.py +0 -0
  72. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/data/settingnode_v2.html.jinja2 +0 -0
  73. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/errors/__init__.py +0 -0
  74. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/helpers/__init__.py +0 -0
  75. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/helpers/json_helper.py +0 -0
  76. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/qcm_data/__init__.py +0 -0
  77. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/qcm_data/file_adapter.py +0 -0
  78. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/qcm_data/immutable_base_model.py +0 -0
  79. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/exa/common/sweep/__init__.py +0 -0
  80. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/iqm_exa_common.egg-info/SOURCES.txt +0 -0
  81. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/iqm_exa_common.egg-info/dependency_links.txt +0 -0
  82. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/iqm_exa_common.egg-info/requires.txt +0 -0
  83. {iqm_exa_common-25.31 → iqm_exa_common-25.33}/src/iqm_exa_common.egg-info/top_level.txt +0 -0
@@ -2,6 +2,24 @@
2
2
  Changelog
3
3
  =========
4
4
 
5
+ Version 25.33 (2025-02-04)
6
+ --------------------------
7
+
8
+ Features
9
+ --------
10
+
11
+ - Refactor codebase to new lint rules. No functional changes. :issue:`SW-467`
12
+
13
+
14
+ Version 25.32 (2025-02-04)
15
+ --------------------------
16
+
17
+ Features
18
+ --------
19
+
20
+ - Refactor codebase to new lint rules. No functional changes. :issue:`SW-467`
21
+
22
+
5
23
  Version 25.31 (2025-01-28)
6
24
  --------------------------
7
25
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-exa-common
3
- Version: 25.31
3
+ Version: 25.33
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
@@ -21,24 +21,11 @@ file = "LICENSE.txt"
21
21
  Documentation = "https://iqm-finland.github.io/docs/iqm-exa-common/"
22
22
  Homepage = "https://pypi.org/project/iqm-exa-common/"
23
23
 
24
- [tool.black]
24
+ [tool.ruff]
25
+ exclude = [ "*.ipynb", "*.rst",]
26
+ extend-include = [ "sub-setup-py.template",]
25
27
  line-length = 120
26
28
 
27
- [tool.isort]
28
- balanced_wrapping = true
29
- force_sort_within_sections = true
30
- group_by_package = true
31
- known_first_party = [ "exa.common", "tests",]
32
- known_third_party = [ "exa",]
33
- line_length = 120
34
- order_by_type = true
35
- profile = "black"
36
- reverse_relative = true
37
- use_parentheses = true
38
-
39
- [tool.mypy]
40
- ignore_missing_imports = true
41
-
42
29
  [tool.setuptools_scm]
43
30
  fallback_version = "0.1"
44
31
 
@@ -52,35 +39,34 @@ exclude_lines = [ "pragma: no cover", "def __repr__", "if self\\.debug", "raise
52
39
  branch = true
53
40
  source = [ "exa.common",]
54
41
 
55
- [tool.pylint.basic]
56
- good-names = [ "i", "j", "k", "ex", "Run", "_", "pk", "x", "y", "z", "g", "T1", "T2", "ax", "cz", "vz", "rz",]
57
-
58
- [tool.pylint.design]
59
- max-args = 15
60
- max-locals = 50
61
- max-public-methods = 30
62
-
63
- [tool.pylint.format]
64
- max-line-length = 120
65
-
66
- [tool.pylint.main]
67
- init-hook = "import sys; sys.path.append('.')"
68
-
69
- [tool.pylint."message control"]
70
- disable = [ "ungrouped-imports", "wrong-import-order", "fixme", "arguments-differ", "arguments-renamed",]
71
-
72
- [tool.pylint.miscellaneous]
73
- notes = [ "TODO",]
74
-
75
- [tool.pylint.similarities]
76
- ignore-imports = true
77
- min-similarity-lines = 20
78
-
79
- [tool.pylint.string]
80
- check-quote-consistency = true
81
-
82
42
  [tool.pytest.ini_options]
83
43
  nb_diff_ignore = [ "/metadata/language_info", "/metadata/widgets", "/cells/*/execution_count", "/cells/*/outputs",]
84
44
 
45
+ [tool.ruff.lint]
46
+ ignore = [ "D203", "D213",]
47
+ select = [ "E4", "E7", "E9", "E5", "F", "Q", "PL", "I", "D",]
48
+ unfixable = [ "F401",]
49
+
50
+ [tool.ruff.lint.isort]
51
+ force-sort-within-sections = true
52
+ known-first-party = [ "exa.experiments", "exa.core", "exa.common", "cocos", "gbc", "calibration_graphs", "iqm.pulse", "iqm.cpc", "iqm.pulla", "iqm.station_control", "tests",]
53
+ known-local-folder = [ "src",]
54
+ known-third-party = [ "exa", "iqm",]
55
+ relative-imports-order = "closest-to-furthest"
56
+
57
+ [tool.ruff.lint.per-file-ignores]
58
+ "**/__init__.py" = [ "F401", "PLR0402",]
59
+ "**/docs/*" = [ "E402", "D100",]
60
+ "**/setup.py" = [ "D100", "D103", "I001",]
61
+ "**/src/*" = [ "PLR2004", "D400", "D415", "D205", "D401", "D417", "D100", "D101", "D107", "D102", "D105", "D103", "D404", "D104",]
62
+ "**/tests/*" = [ "F632", "PLR2004", "PLR0402", "PLC0414", "D",]
63
+
64
+ [tool.ruff.lint.pylint]
65
+ max-args = 8
66
+ max-branches = 16
67
+ max-locals = 21
68
+ max-returns = 9
69
+ max-statements = 60
70
+
85
71
  [tool.setuptools.dynamic.dependencies]
86
72
  file = "requirements/base.txt"
@@ -5,16 +5,21 @@
5
5
  # Distribution or reproduction of any information contained herein
6
6
  # is prohibited without IQM Finland Oy’s prior written permission.
7
7
  # ********************************************************************************
8
+ """Common setup for subdirectories."""
8
9
 
9
- from setuptools import setup
10
10
  from pathlib import Path
11
11
 
12
+ from setuptools import setup
13
+
14
+
12
15
  def get_version():
16
+ """Get version from the file version.txt."""
13
17
  build_version_fpath = Path("version.txt")
14
18
  if build_version_fpath.exists():
15
19
  # Assume there's only one line specifying the version in the file
16
20
  return build_version_fpath.read_text().strip()
17
21
  return "0.1dev0"
18
22
 
23
+
19
24
  if __name__ == "__main__":
20
25
  setup(version=get_version())
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Shared errors, helpers, control structures, settings, API models etc."""
16
+
16
17
  from importlib.metadata import PackageNotFoundError, version
17
18
 
18
19
  try:
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Pydantic model for Parameter."""
16
+
16
17
  from __future__ import annotations
17
18
 
18
19
  from typing import Optional, Tuple
@@ -23,9 +24,7 @@ from exa.common.data.parameter import CollectionType, DataType, Parameter
23
24
 
24
25
 
25
26
  class ParameterModel(BaseModel):
26
- """
27
- Pydantic parameter model
28
- """
27
+ """Pydantic parameter model""" # noqa: D200
29
28
 
30
29
  name: str
31
30
  parent_name: Optional[str] = None
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Pydantic model for Setting."""
16
+
16
17
  from __future__ import annotations
17
18
 
18
19
  from typing import Any
@@ -26,9 +27,7 @@ from exa.common.helpers.numpy_helper import coerce_numpy_type_to_native
26
27
 
27
28
 
28
29
  class SettingModel(BaseModel):
29
- """
30
- Pydantic setting model
31
- """
30
+ """Pydantic setting model""" # noqa: D200
32
31
 
33
32
  parameter: ParameterModel
34
33
  value: Any = None
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Pydantic model for SettingNode."""
16
+
16
17
  from __future__ import annotations
17
18
 
18
19
  from typing import Any, Dict
@@ -24,9 +25,7 @@ from exa.common.data.setting_node import SettingNode
24
25
 
25
26
 
26
27
  class SettingNodeModel(BaseModel):
27
- """
28
- Pydantic setting node model
29
- """
28
+ """Pydantic setting node model""" # noqa: D200
30
29
 
31
30
  name: str
32
31
  settings: Dict[str, SettingModel]
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Pydantic model for Sweep."""
16
+
16
17
  from __future__ import annotations
17
18
 
18
19
  from typing import Any
@@ -13,13 +13,11 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Pack and unpack parameters to protos and back."""
16
+
16
17
  import iqm.data_definitions.common.v1.parameter_pb2 as ppb
17
18
 
18
19
  from exa.common.data.parameter import CollectionType, DataType, Parameter
19
20
 
20
- # pylint: disable=no-member
21
-
22
-
23
21
  _COLLECTION_TYPES = {
24
22
  CollectionType.SCALAR: ppb.Parameter.CollectionType.COLLECTION_TYPE_SCALAR,
25
23
  CollectionType.LIST: ppb.Parameter.CollectionType.COLLECTION_TYPE_SEQUENCE,
@@ -14,7 +14,6 @@
14
14
 
15
15
  """Convert numpy arrays to protos and back."""
16
16
 
17
- # pylint: disable=no-member
18
17
  import iqm.data_definitions.common.v1.data_types_pb2 as dpb
19
18
  import numpy as np
20
19
 
@@ -27,6 +26,7 @@ def pack(array: np.ndarray) -> dpb.Array:
27
26
 
28
27
  Returns:
29
28
  A protobuf instance that encapsulates `array`.
29
+
30
30
  """
31
31
  target = dpb.Array()
32
32
  target.shape.MergeFrom(array.shape)
@@ -65,6 +65,7 @@ def unpack(source: dpb.Array) -> np.ndarray:
65
65
 
66
66
  Raises:
67
67
  ValueError or google.protobuf.message.DecodeError in case of invalid buffer
68
+
68
69
  """
69
70
  kind = source.WhichOneof("kind")
70
71
  if kind is None:
@@ -16,12 +16,10 @@
16
16
 
17
17
  from typing import Optional, Sequence, Union
18
18
 
19
- # pylint: disable=no-member
20
19
  import iqm.data_definitions.common.v1.data_types_pb2 as dpb
21
20
  import numpy as np
22
21
 
23
- import exa.common.api.proto_serialization.array as array
24
- import exa.common.api.proto_serialization.sequence as sequence
22
+ from exa.common.api.proto_serialization import array, sequence
25
23
 
26
24
 
27
25
  def pack(value: Union[None, bool, str, int, float, complex, np.ndarray, Sequence]) -> dpb.Datum:
@@ -43,6 +41,7 @@ def pack(value: Union[None, bool, str, int, float, complex, np.ndarray, Sequence
43
41
 
44
42
  Raises:
45
43
  TypeError in case of unsupported type.
44
+
46
45
  """
47
46
  if isinstance(value, np.number):
48
47
  raise TypeError(
@@ -78,6 +77,7 @@ def unpack(source: dpb.Datum) -> Union[None, str, bool, int, float, complex, np.
78
77
 
79
78
  Raises:
80
79
  TypeError or google.protobuf.message.DecodeError in case of invalid buffer
80
+
81
81
  """
82
82
  field_name = source.WhichOneof("kind")
83
83
  if field_name == "null_value":
@@ -107,6 +107,7 @@ def serialize(value: Union[None, bool, str, int, float, complex, np.ndarray, Seq
107
107
 
108
108
  Returns:
109
109
  Bitstring that encodes `value`.
110
+
110
111
  """
111
112
  return pack(value).SerializeToString()
112
113
 
@@ -119,6 +120,7 @@ def deserialize(source: bytes) -> Union[None, str, bool, int, float, complex, np
119
120
 
120
121
  Returns:
121
122
  Deserialized data.
123
+
122
124
  """
123
125
  proto = dpb.Datum()
124
126
  proto.ParseFromString(source)
@@ -13,7 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Convert NdSweeps to protos and back."""
16
- # pylint: disable=no-member
16
+
17
17
  import iqm.data_definitions.common.v1.sweep_pb2 as spb
18
18
 
19
19
  from exa.common.api.proto_serialization import sequence
@@ -45,7 +45,6 @@ def unpack(proto: spb.CartesianSweep) -> NdSweep:
45
45
 
46
46
  Note: All sweeps will be of type :class:`.FixedSweep`.
47
47
  """
48
-
49
48
  nd_sweep = []
50
49
  for parallel_proto in reversed(proto.parallel_sweeps):
51
50
  parallel = tuple(_unpack_single_sweep(sweep) for sweep in parallel_proto.single_parameter_sweeps)
@@ -16,7 +16,6 @@
16
16
 
17
17
  from typing import Sequence
18
18
 
19
- # pylint: disable=no-member
20
19
  import iqm.data_definitions.common.v1.data_types_pb2 as dpb
21
20
  import numpy as np
22
21
 
@@ -32,23 +31,24 @@ def pack(values: Sequence) -> dpb.Sequence:
32
31
 
33
32
  Raises:
34
33
  ValueError in case of unsupported value.
34
+
35
35
  """
36
36
  target = dpb.Sequence()
37
37
  if not values:
38
38
  return target
39
39
  dtype = type(values[0])
40
- if dtype == complex:
40
+ if dtype == complex: # noqa: E721
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:
45
+ if dtype == bool: # noqa: E721
46
46
  target_field = target.bool_array
47
- elif dtype == int:
47
+ elif dtype == int: # noqa: E721
48
48
  target_field = target.int64_array
49
- elif dtype == float:
49
+ elif dtype == float: # noqa: E721
50
50
  target_field = target.float64_array
51
- elif dtype == str:
51
+ elif dtype == str: # noqa: E721
52
52
  target_field = target.string_array
53
53
  else:
54
54
  raise TypeError(f"Unsupported numpy array type {dtype} for a sequence.")
@@ -68,6 +68,7 @@ def unpack(source: dpb.Sequence) -> list:
68
68
 
69
69
  Raises:
70
70
  ValueError or google.protobuf.message.DecodeError in case of invalid buffer
71
+
71
72
  """
72
73
  kind = source.WhichOneof("kind")
73
74
  if kind is None:
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Convert SettingNodes to protos and back."""
16
+
16
17
  import iqm.data_definitions.common.v1.setting_pb2 as spb
17
18
 
18
19
  from exa.common.api.proto_serialization import datum
@@ -21,8 +22,6 @@ from exa.common.data.parameter import DataType, Parameter
21
22
  from exa.common.data.setting_node import Setting, SettingNode
22
23
  from exa.common.helpers.numpy_helper import coerce_numpy_type_to_native
23
24
 
24
- # pylint: disable=no-member
25
-
26
25
 
27
26
  def _pack_setting(setting: Setting, optimize: bool) -> spb.SettingNode.Setting:
28
27
  """Convert a Setting into protobuf representation."""
@@ -66,6 +65,7 @@ def pack(node: SettingNode, minimal: bool) -> spb.SettingNode:
66
65
 
67
66
  Returns:
68
67
  Protobuf instance that represents `node`.
68
+
69
69
  """
70
70
  settings = {key: _pack_setting(item, minimal) for key, item in node.child_settings}
71
71
  nodes = {key: pack(item, minimal) for key, item in node.child_nodes}
@@ -81,6 +81,7 @@ def unpack(proto: spb.SettingNode) -> SettingNode:
81
81
  Returns:
82
82
  Unpacked SettingNode. In case `proto` only contains the parameter names (see ``optimize`` in
83
83
  :func:`.pack`), dummy Parameters are generated.
84
+
84
85
  """
85
86
  settings = {key: _unpack_setting(content) for key, content in proto.settings.items()}
86
87
  nodes = {key: unpack(content) for key, content in proto.subnodes.items()}
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Sweep specification with exponentially spaced values."""
16
+
16
17
  from dataclasses import dataclass, field
17
18
  import logging
18
19
  import math
@@ -37,6 +38,7 @@ class ExponentialSweep(Sweep):
37
38
 
38
39
  Raises:
39
40
  ValueError: Error is raised if `options` is inconsistent.
41
+
40
42
  """
41
43
 
42
44
  logger: logging.Logger = field(init=False)
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Sweep specification with arbitrary values."""
16
+
16
17
  from dataclasses import dataclass
17
18
 
18
19
  import numpy as np
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Sweep specification with generated parameter values based on callable object."""
16
+
16
17
  from dataclasses import dataclass
17
18
 
18
19
  from exa.common.control.sweep.option import FunctionOptions
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Sweep specification with linearly spaced values."""
16
+
16
17
  from dataclasses import dataclass
17
18
  import math
18
19
  from typing import Union
@@ -34,6 +35,7 @@ class LinearSweep(Sweep):
34
35
 
35
36
  Raises:
36
37
  ValueError: Error is raised if `options` is inconsistent.
38
+
37
39
  """
38
40
 
39
41
  def __post_init__(self):
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Range specification used with ExponentialSweep."""
16
+
16
17
  from dataclasses import dataclass
17
18
  from typing import Union
18
19
 
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Range specification to define a range around a center value."""
16
+
16
17
  from dataclasses import dataclass
17
18
  from typing import Union
18
19
 
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Helper constants for SweepOptions classes."""
16
+
16
17
  from typing import Any, Dict
17
18
 
18
19
  #: Default value for `count` value in options.
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Range specification for arbitrary set of values."""
16
+
16
17
  from dataclasses import dataclass
17
18
  from typing import List, Union
18
19
 
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Helper to create a SweepOptions instance from a dict."""
16
+
16
17
  import ast
17
18
  from typing import Any, Dict, List
18
19
 
@@ -45,6 +46,7 @@ def convert_to_options(config: Dict[str, Any]) -> SweepOptions:
45
46
 
46
47
  Raises:
47
48
  ValueError: Error is raised if config has unsupported structure
49
+
48
50
  """
49
51
  config = {k.lower(): v for k, v in config.items()}
50
52
  if {OPTIONS_TYPE.get("start"), OPTIONS_TYPE.get("stop")}.issubset(set(config)):
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Range specification used with ExponentialSweep."""
16
+
16
17
  from dataclasses import dataclass
17
18
  from typing import Union
18
19
 
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Range specification to define a linearly spaced interval."""
16
+
16
17
  from dataclasses import dataclass
17
18
  from typing import Union
18
19
 
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Base immutable class for sweeps specifications."""
16
+
16
17
  from dataclasses import dataclass, field
17
18
  from typing import Any, List, Union
18
19
 
@@ -54,6 +54,7 @@ parameter.
54
54
  True
55
55
 
56
56
  """
57
+
57
58
  from __future__ import annotations
58
59
 
59
60
  import ast
@@ -250,11 +251,12 @@ class Parameter:
250
251
  ``variables = [(par_x: [1,2,3])], extra_variables=[('y', 2)]`` yields the same 3-by-2 data. ``'y'`` will then be
251
252
  a "dimension without coordinate" in xarray terms.
252
253
 
253
- Args:
254
+ Args:
254
255
  variables: Coordinates of the set.
255
256
  data: Data Parameter and associated data as a possible nested list.
256
257
  attributes: metadata to attach to the whole Dataset.
257
258
  extra_variables: Valueless dimensions and their sizes.
259
+
258
260
  """
259
261
  variable_names = []
260
262
  variable_sizes = []
@@ -321,6 +323,7 @@ class Parameter:
321
323
 
322
324
  Returns:
323
325
  corresponding DataArray
326
+
324
327
  """
325
328
  if dimensions is None:
326
329
  if len(data.shape) == 1:
@@ -356,6 +359,7 @@ class Parameter:
356
359
 
357
360
  Raises:
358
361
  InvalidParameterValueError: If ``self`` is not collection-valued.
362
+
359
363
  """
360
364
  if self.collection_type is CollectionType.SCALAR:
361
365
  raise InvalidParameterValueError(
@@ -458,6 +462,7 @@ class Setting:
458
462
  Returns:
459
463
  A new set of Settings whose parameters are only found in `first`, and Settings in `first` whose
460
464
  values differ from their counterparts in `second`.
465
+
461
466
  """
462
467
  diff = first.difference(second)
463
468
  for s in first.intersection(second):
@@ -492,6 +497,7 @@ class Setting:
492
497
 
493
498
  Raises:
494
499
  ValueError: If ``self`` is not collection-valued.
500
+
495
501
  """
496
502
  return self.parameter.create_element_parameter_for(indices)
497
503