Skip to content

Commit

Permalink
Modify deprecation of total_bottom_detuning to v0.18 (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-corni authored Feb 5, 2024
1 parent a8d17f2 commit 824069a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion pulser-core/pulser/channels/dmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
28 changes: 14 additions & 14 deletions tests/test_abstract_repr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 824069a

Please sign in to comment.