From e1dcf47a801cc504da1084d88153b2c74f1283e7 Mon Sep 17 00:00:00 2001 From: Antoine Cornillot <61453516+a-corni@users.noreply.github.com> Date: Thu, 16 Nov 2023 10:25:52 +0100 Subject: [PATCH] Release v15.3 (#611) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [FIX] Allow parametrized phase in EOM mode (#599) * Parametrized pulse in EOM fix * Restrict to mypy 1.1.1 * Move to 1.3.0 * Fix pydantic * Blocking type checking of referencing.py * skipping imports for referencing * silenting import errors with referencing * Skip referencing in mypy --------- Co-authored-by: Henrique Silvério --- .mypy.ini | 3 +++ VERSION.txt | 2 +- pulser-core/pulser/sequence/sequence.py | 2 +- tests/test_paramseq.py | 7 +++++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.mypy.ini b/.mypy.ini index e3dd5e8d6..c1a1146f0 100644 --- a/.mypy.ini +++ b/.mypy.ini @@ -15,6 +15,9 @@ disallow_untyped_defs = True follow_imports = silent ignore_missing_imports = True +[mypy-referencing.*] +follow_imports = skip + [mypy-tests.*] disable_error_code = annotation-unchecked disallow_untyped_defs = False diff --git a/VERSION.txt b/VERSION.txt index 4312e0d0c..1985d9141 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -0.15.2 +0.15.3 diff --git a/pulser-core/pulser/sequence/sequence.py b/pulser-core/pulser/sequence/sequence.py index aba14b16a..f5762cfcc 100644 --- a/pulser-core/pulser/sequence/sequence.py +++ b/pulser-core/pulser/sequence/sequence.py @@ -1220,7 +1220,7 @@ def add_eom_pulse( channel_obj = self.declared_channels[channel] channel_obj.validate_duration(duration) for arg in (phase, post_phase_shift): - if not isinstance(arg, (float, int)): + if not isinstance(arg, (Parametrized, float, int)): raise TypeError("Phase values must be a numeric value.") return diff --git a/tests/test_paramseq.py b/tests/test_paramseq.py index e311426b8..256469fcf 100644 --- a/tests/test_paramseq.py +++ b/tests/test_paramseq.py @@ -319,13 +319,16 @@ def test_parametrized_before_eom_mode(mod_device): with pytest.raises(ValueError, match="duration has to be at least"): seq.add_eom_pulse("ch0", 0, 0.0) - seq.add_eom_pulse("ch0", 100, 0.0) + var = seq.declare_variable("var", dtype=float, size=None) + seq.add_eom_pulse("ch0", 100, 0.0, post_phase_shift=var) + seq.add_eom_pulse("ch0", var * 1000, np.pi) + seq.add_eom_pulse("ch0", 200, var) seq.disable_eom_mode("ch0") assert not seq.is_in_eom_mode("ch0") # Just check that building works - seq.build(amp=3.0) + seq.build(amp=3.0, var=0.5) def test_iterable_variable_check():