iqm-exa-common 26.6__py3-none-any.whl → 26.8__py3-none-any.whl
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.
- exa/common/control/sweep/exponential_sweep.py +4 -2
- exa/common/control/sweep/fixed_sweep.py +4 -2
- exa/common/control/sweep/linear_sweep.py +4 -2
- exa/common/data/base_model.py +5 -5
- exa/common/data/parameter.py +1 -1
- exa/common/errors/exa_error.py +4 -2
- exa/common/helpers/deprecation.py +12 -0
- {iqm_exa_common-26.6.dist-info → iqm_exa_common-26.8.dist-info}/METADATA +1 -1
- {iqm_exa_common-26.6.dist-info → iqm_exa_common-26.8.dist-info}/RECORD +12 -11
- {iqm_exa_common-26.6.dist-info → iqm_exa_common-26.8.dist-info}/LICENSE.txt +0 -0
- {iqm_exa_common-26.6.dist-info → iqm_exa_common-26.8.dist-info}/WHEEL +0 -0
- {iqm_exa_common-26.6.dist-info → iqm_exa_common-26.8.dist-info}/top_level.txt +0 -0
|
@@ -15,14 +15,17 @@
|
|
|
15
15
|
"""Sweep specification with exponentially spaced values."""
|
|
16
16
|
|
|
17
17
|
from typing import Any
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
from typing_extensions import deprecated
|
|
19
20
|
|
|
20
21
|
from exa.common.control.sweep.option import CenterSpanBaseOptions, StartStopBaseOptions
|
|
21
22
|
from exa.common.control.sweep.sweep import Sweep
|
|
22
23
|
from exa.common.data.parameter import Parameter
|
|
23
24
|
from exa.common.errors.exa_error import InvalidSweepOptionsTypeError
|
|
25
|
+
from exa.common.helpers.deprecation import format_deprecated
|
|
24
26
|
|
|
25
27
|
|
|
28
|
+
@deprecated(format_deprecated(old="`ExponentialSweep`", new="`Sweep`", since="28.3.2025"))
|
|
26
29
|
class ExponentialSweep(Sweep):
|
|
27
30
|
"""Generates parameter values spaced evenly on a geometric progression based on `options`.
|
|
28
31
|
|
|
@@ -45,7 +48,6 @@ class ExponentialSweep(Sweep):
|
|
|
45
48
|
data: list[Any] | None = None,
|
|
46
49
|
**kwargs,
|
|
47
50
|
) -> None:
|
|
48
|
-
warnings.warn("ExponentialSweep is deprecated, use Sweep instead.", DeprecationWarning)
|
|
49
51
|
if options and not isinstance(options, StartStopBaseOptions | CenterSpanBaseOptions):
|
|
50
52
|
raise InvalidSweepOptionsTypeError(str(type(options)))
|
|
51
53
|
super().__init__(parameter, options, data=data, **kwargs)
|
|
@@ -15,21 +15,23 @@
|
|
|
15
15
|
"""Sweep specification with arbitrary values."""
|
|
16
16
|
|
|
17
17
|
from typing import Any
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
from typing_extensions import deprecated
|
|
19
20
|
|
|
20
21
|
from exa.common.control.sweep.option import FixedOptions
|
|
21
22
|
from exa.common.control.sweep.sweep import Sweep
|
|
22
23
|
from exa.common.data.parameter import Parameter
|
|
23
24
|
from exa.common.errors.exa_error import InvalidSweepOptionsTypeError
|
|
25
|
+
from exa.common.helpers.deprecation import format_deprecated
|
|
24
26
|
|
|
25
27
|
|
|
28
|
+
@deprecated(format_deprecated(old="`FixedSweep`", new="`Sweep`", since="28.3.2025"))
|
|
26
29
|
class FixedSweep(Sweep):
|
|
27
30
|
"""A sweep over arbitrary set of values, given by `options`."""
|
|
28
31
|
|
|
29
32
|
def __init__(
|
|
30
33
|
self, parameter: Parameter, options: FixedOptions | None = None, *, data: list[Any] | None = None, **kwargs
|
|
31
34
|
) -> None:
|
|
32
|
-
warnings.warn("FixedSweep is deprecated, use Sweep instead.", DeprecationWarning)
|
|
33
35
|
if options and not isinstance(options, FixedOptions):
|
|
34
36
|
raise InvalidSweepOptionsTypeError(str(type(options)))
|
|
35
37
|
super().__init__(parameter, options, data=data, **kwargs)
|
|
@@ -15,14 +15,17 @@
|
|
|
15
15
|
"""Sweep specification with linearly spaced values."""
|
|
16
16
|
|
|
17
17
|
from typing import Any
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
from typing_extensions import deprecated
|
|
19
20
|
|
|
20
21
|
from exa.common.control.sweep.option import CenterSpanOptions, StartStopOptions
|
|
21
22
|
from exa.common.control.sweep.sweep import Sweep
|
|
22
23
|
from exa.common.data.parameter import Parameter
|
|
23
24
|
from exa.common.errors.exa_error import InvalidSweepOptionsTypeError
|
|
25
|
+
from exa.common.helpers.deprecation import format_deprecated
|
|
24
26
|
|
|
25
27
|
|
|
28
|
+
@deprecated(format_deprecated(old="`LinearSweep`", new="`Sweep`", since="28.3.2025"))
|
|
26
29
|
class LinearSweep(Sweep):
|
|
27
30
|
"""Generates evenly spaced parameter values based on `options`.
|
|
28
31
|
|
|
@@ -43,7 +46,6 @@ class LinearSweep(Sweep):
|
|
|
43
46
|
data: list[Any] | None = None,
|
|
44
47
|
**kwargs,
|
|
45
48
|
) -> None:
|
|
46
|
-
warnings.warn("LinearSweep is deprecated, use Sweep instead.", DeprecationWarning)
|
|
47
49
|
if options and not isinstance(options, StartStopOptions | CenterSpanOptions):
|
|
48
50
|
raise InvalidSweepOptionsTypeError(str(type(options)))
|
|
49
51
|
super().__init__(parameter, options, data=data, **kwargs)
|
exa/common/data/base_model.py
CHANGED
|
@@ -2,6 +2,9 @@ from typing import Any, Self
|
|
|
2
2
|
|
|
3
3
|
import pydantic
|
|
4
4
|
from pydantic import ConfigDict
|
|
5
|
+
from typing_extensions import deprecated
|
|
6
|
+
|
|
7
|
+
from exa.common.helpers.deprecation import format_deprecated
|
|
5
8
|
|
|
6
9
|
|
|
7
10
|
class BaseModel(pydantic.BaseModel):
|
|
@@ -28,10 +31,7 @@ class BaseModel(pydantic.BaseModel):
|
|
|
28
31
|
"""
|
|
29
32
|
return super().model_copy(update=update, deep=deep)
|
|
30
33
|
|
|
34
|
+
@deprecated(format_deprecated(old="`copy` method", new="`model_copy`", since="28.3.2025"))
|
|
31
35
|
def copy(self, **kwargs) -> Self:
|
|
32
|
-
"""Returns a copy of the model.
|
|
33
|
-
|
|
34
|
-
DEPRECATED: Use model_copy(update: dict[str, Any], deep: bool) instead.
|
|
35
|
-
"""
|
|
36
|
-
# Call deprecated copy() here deliberately to trigger deprecation warning from Pydantic.
|
|
36
|
+
"""Returns a copy of the model."""
|
|
37
37
|
return super().copy(update=kwargs, deep=True)
|
exa/common/data/parameter.py
CHANGED
|
@@ -209,7 +209,7 @@ class Parameter(BaseModel):
|
|
|
209
209
|
label = name
|
|
210
210
|
if data_type == DataType.NUMBER:
|
|
211
211
|
warnings.warn(
|
|
212
|
-
"data_type 'DataType.NUMBER' is deprecated,
|
|
212
|
+
"data_type 'DataType.NUMBER' is deprecated, use 'DataType.FLOAT' instead.",
|
|
213
213
|
DeprecationWarning,
|
|
214
214
|
)
|
|
215
215
|
# Consider DataType.NUMBER as a deprecated alias for DataType.FLOAT
|
exa/common/errors/exa_error.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
from typing_extensions import deprecated
|
|
2
|
+
|
|
3
|
+
from exa.common.helpers.deprecation import format_deprecated
|
|
2
4
|
|
|
3
5
|
|
|
4
6
|
class ExaError(Exception):
|
|
@@ -25,9 +27,9 @@ class EmptyComponentListError(ExaError, ValueError):
|
|
|
25
27
|
"""Error raised when an empty list is given as components for running an experiment."""
|
|
26
28
|
|
|
27
29
|
|
|
30
|
+
@deprecated(format_deprecated(old="`InvalidSweepOptionsTypeError`", new="`Sweep.data`", since="28.3.2025"))
|
|
28
31
|
class InvalidSweepOptionsTypeError(ExaError, TypeError):
|
|
29
32
|
"""The type of sweep options is invalid."""
|
|
30
33
|
|
|
31
34
|
def __init__(self, options: str, *args):
|
|
32
|
-
warnings.warn("InvalidSweepOptionsTypeError is deprecated.", DeprecationWarning)
|
|
33
35
|
super().__init__(f"Options have unsupported type of {options}", *args)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import LiteralString
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def format_deprecated(old: str, new: str | None, since: str) -> LiteralString:
|
|
6
|
+
datetime.strptime(since, "%d.%m.%Y")
|
|
7
|
+
message: str = (
|
|
8
|
+
f"{old} is deprecated since {since}, it can be be removed from the codebase in the next major release."
|
|
9
|
+
)
|
|
10
|
+
if new:
|
|
11
|
+
message += f" Use {new} instead."
|
|
12
|
+
return message
|
|
@@ -9,9 +9,9 @@ exa/common/api/proto_serialization/sequence.py,sha256=ACmMyDqCWve33GhHTTDjc2LaBo
|
|
|
9
9
|
exa/common/api/proto_serialization/setting_node.py,sha256=KCNpwgwIrgyuXsgt-rAm3oEQqKlIxtN8JBUDFaQTJ48,3940
|
|
10
10
|
exa/common/control/__init__.py,sha256=00T_xV0lL20QZcEt__vWq81N1oGF0KpJMhTitfAI4VI,629
|
|
11
11
|
exa/common/control/sweep/__init__.py,sha256=GzKoQdQsLutcHhmrLPyPrW1n7Cpg766p3OWDHlRpuTs,607
|
|
12
|
-
exa/common/control/sweep/exponential_sweep.py,sha256=
|
|
13
|
-
exa/common/control/sweep/fixed_sweep.py,sha256=
|
|
14
|
-
exa/common/control/sweep/linear_sweep.py,sha256=
|
|
12
|
+
exa/common/control/sweep/exponential_sweep.py,sha256=OIGqSifkAgQcS2EdffDpIjibB80XteLVF82kS63vPro,2121
|
|
13
|
+
exa/common/control/sweep/fixed_sweep.py,sha256=QXO5lrllHHlhLiA95s8iTE82QkAEzgjJ2dA0flRJLhs,1493
|
|
14
|
+
exa/common/control/sweep/linear_sweep.py,sha256=fX7OuZDYtUSGcAJLsGTVHcCIRkUHkZNLy5YSe_kgb8M,1966
|
|
15
15
|
exa/common/control/sweep/sweep.py,sha256=0ZzhbzcAQaByiX7dz5jDH0r1zmyEiW2B-v8edIyTDs8,3442
|
|
16
16
|
exa/common/control/sweep/sweep_values.py,sha256=pGvds0ZVgMIL6ztE6hGXEzC9E7rvAzeVwvHCG5v6XC8,2298
|
|
17
17
|
exa/common/control/sweep/option/__init__.py,sha256=Z01JS0FpchMvR8zfWBCs3jcPjh2H8X29YkN0SFxWLTY,906
|
|
@@ -24,16 +24,17 @@ exa/common/control/sweep/option/start_stop_base_options.py,sha256=hZCIflh8NzK48c
|
|
|
24
24
|
exa/common/control/sweep/option/start_stop_options.py,sha256=HaQFNlhRPep2yrn_LuOkuZ0imwBEidpD0BTPWf-Svf4,3038
|
|
25
25
|
exa/common/control/sweep/option/sweep_options.py,sha256=BhKB7RHP0VXJ9iUQKVzeQOM4j_x9AsMhRJgoR3gkiaY,933
|
|
26
26
|
exa/common/data/__init__.py,sha256=F5SRe5QHBTjef4XJVQ63kO5Oxc_AiZnPbV560i7La0Y,644
|
|
27
|
-
exa/common/data/base_model.py,sha256=
|
|
28
|
-
exa/common/data/parameter.py,sha256=
|
|
27
|
+
exa/common/data/base_model.py,sha256=Zap09R91zHY3iYtfO-SqxfKdewCf3q5FNi1uefTtSfQ,1796
|
|
28
|
+
exa/common/data/parameter.py,sha256=eOssAtz34Y9MzZ0BZlUkJeOGaFVISH8aiPZE7QTMHo8,23166
|
|
29
29
|
exa/common/data/setting_node.py,sha256=WldawevXuOb2uN-bjZ04hWijKqX_MOdkyMsgxOZbrek,43190
|
|
30
30
|
exa/common/data/settingnode_v2.html.jinja2,sha256=mo-rlLLmU-Xxf6znJAisispAZK8sbV-2C13byKAtj_Q,3166
|
|
31
31
|
exa/common/data/value.py,sha256=mtMws5UPGx1pCADK6Q2Tx4BwCXznvVRSNQRfcQ3NMmY,1853
|
|
32
32
|
exa/common/errors/__init__.py,sha256=ArMBdpmx1EUenBpzrSNG63kmUf7PM0gCqSYnaCnL9Qk,597
|
|
33
|
-
exa/common/errors/exa_error.py,sha256=
|
|
33
|
+
exa/common/errors/exa_error.py,sha256=iw8ueZgqx1JXkfjRoJfPUsSE7cfhzIWpdDaFuka9Ss0,990
|
|
34
34
|
exa/common/errors/server_errors.py,sha256=4BLTUtlJRLTyR1mW2b_mAtkj90UCNZ8pS8-p_SWWfYM,2810
|
|
35
35
|
exa/common/helpers/__init__.py,sha256=IgtVD3tojIFA4MTV2mT5uYM6jb2qny9kBIIhEZT2PuI,610
|
|
36
36
|
exa/common/helpers/data_helper.py,sha256=vhzJ63g1S2JqnCj0WJJuqWcuiIwKATnQeHdWw_3gkZg,1934
|
|
37
|
+
exa/common/helpers/deprecation.py,sha256=nY8484iun63JOBfBeh49Q6VD5xZ4_gT9fjPmH1RAXoI,397
|
|
37
38
|
exa/common/helpers/json_helper.py,sha256=VTcYU8FRgv3tXPifuogUWmVAzt_4JoQ_laTHolyodtA,2672
|
|
38
39
|
exa/common/helpers/numpy_helper.py,sha256=KKKyZ_fD0O1gn7_InEQROYnX3WGMA6C1qHh8KzzjtUI,1062
|
|
39
40
|
exa/common/helpers/software_version_helper.py,sha256=kpuQer4p1p4cj9_CzwziBSCX7wuH-FvfNw8G8U-EI3Y,5162
|
|
@@ -48,8 +49,8 @@ exa/common/qcm_data/qcm_data_client.py,sha256=0clAbZ3HPBH9lFOe8cVmaq8hPHG5m3pyPG
|
|
|
48
49
|
exa/common/sweep/__init__.py,sha256=uEKk5AtzSgSnf8Y0geRPwUpqXIBIXpeCxsN64sX7F1o,591
|
|
49
50
|
exa/common/sweep/database_serialization.py,sha256=NUu1umxRQZpKtRmw1vNDsSbnofqbHvKFg_xQ2mdhY6k,7469
|
|
50
51
|
exa/common/sweep/util.py,sha256=-QE2AaH-WDkYAVH5-Z-30leLgY0x4efmby4kc1JTCgY,3732
|
|
51
|
-
iqm_exa_common-26.
|
|
52
|
-
iqm_exa_common-26.
|
|
53
|
-
iqm_exa_common-26.
|
|
54
|
-
iqm_exa_common-26.
|
|
55
|
-
iqm_exa_common-26.
|
|
52
|
+
iqm_exa_common-26.8.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
|
|
53
|
+
iqm_exa_common-26.8.dist-info/METADATA,sha256=65WpaWcEgJu2wLjfrEVsg6KiMhOTZuLc2jeIN357hEw,14548
|
|
54
|
+
iqm_exa_common-26.8.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
|
|
55
|
+
iqm_exa_common-26.8.dist-info/top_level.txt,sha256=Clphg2toaZ3_jSFRPhjMNEmLurkMNMc4lkK2EFYsSlM,4
|
|
56
|
+
iqm_exa_common-26.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|