Skip to content

Commit

Permalink
Release v15.3 (#611)
Browse files Browse the repository at this point in the history
* [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 <henrique.silverio@tecnico.ulisboa.pt>
  • Loading branch information
a-corni and HGSilveri authored Nov 16, 2023
1 parent a531a50 commit e1dcf47
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.15.2
0.15.3
2 changes: 1 addition & 1 deletion pulser-core/pulser/sequence/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 5 additions & 2 deletions tests/test_paramseq.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit e1dcf47

Please sign in to comment.