From 824069a6d5ec475ec005840c24a5b1d951794b32 Mon Sep 17 00:00:00 2001 From: Antoine Cornillot <61453516+a-corni@users.noreply.github.com> Date: Mon, 5 Feb 2024 10:45:59 +0100 Subject: [PATCH] Modify deprecation of total_bottom_detuning to v0.18 (#638) --- pulser-core/pulser/channels/dmm.py | 2 +- tests/test_abstract_repr.py | 28 ++++++++++++++-------------- tests/test_backend.py | 2 +- tests/test_dmm.py | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pulser-core/pulser/channels/dmm.py b/pulser-core/pulser/channels/dmm.py index f5f6009e0..c79d2fad6 100644 --- a/pulser-core/pulser/channels/dmm.py +++ b/pulser-core/pulser/channels/dmm.py @@ -103,7 +103,7 @@ def is_virtual(self) -> bool: virtual_dmm = bool(self._undefined_fields()) if not virtual_dmm and self.total_bottom_detuning is None: warnings.warn( - "From v0.17 and onwards, `total_bottom_detuning` must be" + "From v0.18 and onwards, `total_bottom_detuning` must be" " defined to define a physical DMM.", DeprecationWarning, ) diff --git a/tests/test_abstract_repr.py b/tests/test_abstract_repr.py index f0abe5bb2..4b02eaf92 100644 --- a/tests/test_abstract_repr.py +++ b/tests/test_abstract_repr.py @@ -153,7 +153,7 @@ def _roundtrip(abstract_device): if abstract_device["name"] == "DigitalAnalogDevice": with pytest.warns( - DeprecationWarning, match="From v0.17 and onwards" + DeprecationWarning, match="From v0.18 and onwards" ): _roundtrip(abstract_device) else: @@ -173,7 +173,7 @@ def check_error_raised( if abstract_device["name"] == "DigitalAnalogDevice": with pytest.warns( - DeprecationWarning, match="From v0.17 and onwards" + DeprecationWarning, match="From v0.18 and onwards" ): good_device = deserialize_device(json.dumps(abstract_device)) else: @@ -1127,7 +1127,7 @@ def _get_expression(op: dict) -> Any: class TestDeserialization: @pytest.mark.parametrize("is_phys_Chadoq2", [True, False]) @pytest.mark.filterwarnings( - "ignore:From v0.17 and onwards,.*:DeprecationWarning" + "ignore:From v0.18 and onwards,.*:DeprecationWarning" ) def test_deserialize_device_and_channels(self, is_phys_Chadoq2) -> None: kwargs = {} @@ -1155,7 +1155,7 @@ def test_deserialize_device_and_channels(self, is_phys_Chadoq2) -> None: @pytest.mark.parametrize("layout_coords", [None, _coords]) @pytest.mark.filterwarnings( - "ignore:From v0.17 and onwards,.*:DeprecationWarning" + "ignore:From v0.18 and onwards,.*:DeprecationWarning" ) def test_deserialize_register(self, layout_coords): if layout_coords is not None: @@ -1187,7 +1187,7 @@ def test_deserialize_register(self, layout_coords): assert seq.register.layout is None @pytest.mark.filterwarnings( - "ignore:From v0.17 and onwards,.*:DeprecationWarning" + "ignore:From v0.18 and onwards,.*:DeprecationWarning" ) def test_deserialize_mappable_register(self): layout_coords = (5 * np.arange(8)).reshape((4, 2)) @@ -1311,7 +1311,7 @@ def test_deserialize_seq_with_mag_field(self): @pytest.mark.parametrize("without_default", [True, False]) @pytest.mark.filterwarnings( - "ignore:From v0.17 and onwards,.*:DeprecationWarning" + "ignore:From v0.18 and onwards,.*:DeprecationWarning" ) def test_deserialize_variables(self, without_default): s = _get_serialized_seq( @@ -1443,7 +1443,7 @@ def test_deserialize_non_parametrized_op(self, op): ids=_get_kind, ) @pytest.mark.filterwarnings( - "ignore:From v0.17 and onwards,.*:DeprecationWarning" + "ignore:From v0.18 and onwards,.*:DeprecationWarning" ) def test_deserialize_non_parametrized_waveform(self, wf_obj): s = _get_serialized_seq( @@ -1525,7 +1525,7 @@ def test_deserialize_non_parametrized_waveform(self, wf_obj): assert np.array_equal(wf._samples, wf_obj["samples"]) @pytest.mark.filterwarnings( - "ignore:From v0.17 and onwards,.*:DeprecationWarning" + "ignore:From v0.18 and onwards,.*:DeprecationWarning" ) def test_deserialize_measurement(self): s = _get_serialized_seq() @@ -1592,7 +1592,7 @@ def test_deserialize_measurement(self): ids=_get_op, ) @pytest.mark.filterwarnings( - "ignore:From v0.17 and onwards,.*:DeprecationWarning" + "ignore:From v0.18 and onwards,.*:DeprecationWarning" ) def test_deserialize_parametrized_op(self, op): s = _get_serialized_seq( @@ -1718,7 +1718,7 @@ def test_deserialize_parametrized_op(self, op): ], ) @pytest.mark.filterwarnings( - "ignore:From v0.17 and onwards,.*:DeprecationWarning" + "ignore:From v0.18 and onwards,.*:DeprecationWarning" ) def test_deserialize_parametrized_pulse(self, op, pulse_cls): s = _get_serialized_seq( @@ -1920,7 +1920,7 @@ def test_deserialize_eom_ops(self, correct_phase_drift, var_detuning_on): ids=_get_kind, ) @pytest.mark.filterwarnings( - "ignore:From v0.17 and onwards,.*:DeprecationWarning" + "ignore:From v0.18 and onwards,.*:DeprecationWarning" ) def test_deserialize_parametrized_waveform(self, wf_obj): # var1,2 = duration 1000, 2000 @@ -2033,7 +2033,7 @@ def test_deserialize_parametrized_waveform(self, wf_obj): ids=_get_expression, ) @pytest.mark.filterwarnings( - "ignore:From v0.17 and onwards,.*:DeprecationWarning" + "ignore:From v0.18 and onwards,.*:DeprecationWarning" ) def test_deserialize_param(self, json_param): s = _get_serialized_seq( @@ -2149,7 +2149,7 @@ def test_deserialize_param(self, json_param): ids=["bad_var", "bad_param", "bad_exp"], ) @pytest.mark.filterwarnings( - "ignore:From v0.17 and onwards,.*:DeprecationWarning" + "ignore:From v0.18 and onwards,.*:DeprecationWarning" ) def test_param_exceptions(self, param, msg, patch_jsonschema): s = _get_serialized_seq( @@ -2174,7 +2174,7 @@ def test_param_exceptions(self, param, msg, patch_jsonschema): Sequence.from_abstract_repr(json.dumps(s)) @pytest.mark.filterwarnings( - "ignore:From v0.17 and onwards,.*:DeprecationWarning" + "ignore:From v0.18 and onwards,.*:DeprecationWarning" ) def test_unknow_waveform(self): s = _get_serialized_seq( diff --git a/tests/test_backend.py b/tests/test_backend.py index 1b12f729e..f0aff5d08 100644 --- a/tests/test_backend.py +++ b/tests/test_backend.py @@ -305,7 +305,7 @@ def test_qpu_backend(sequence): TypeError, match="must be a real device, instance of 'Device'" ): QPUBackend(sequence, connection) - with pytest.warns(DeprecationWarning, match="From v0.17"): + with pytest.warns(DeprecationWarning, match="From v0.18"): seq = sequence.switch_device(replace(DigitalAnalogDevice, max_runs=10)) qpu_backend = QPUBackend(seq, connection) with pytest.raises(ValueError, match="'job_params' must be specified"): diff --git a/tests/test_dmm.py b/tests/test_dmm.py index dad3d1aaf..bb4de3abb 100644 --- a/tests/test_dmm.py +++ b/tests/test_dmm.py @@ -331,6 +331,6 @@ def test_validate_pulse(self, physical_dmm): # Should be valid in a physical DMM without global bottom detuning physical_dmm = DMM(bottom_detuning=-1) - with pytest.warns(DeprecationWarning, match="From v0.17 and onwards"): + with pytest.warns(DeprecationWarning, match="From v0.18 and onwards"): assert not physical_dmm.is_virtual() physical_dmm.validate_pulse(too_low_pulse, det_map)