Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reset_event_timer defaults to True in sub-sequences #194

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/useq/_iter_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def _iter_sequence(
_pos, _offsets = _position_offsets(position, event_kwargs)
# build overrides for this position
pos_overrides = MDAEventDict(sequence=sequence, **_pos)
pos_overrides["reset_event_timer"] = False
if position.name:
pos_overrides["pos_name"] = position.name

Expand Down
26 changes: 26 additions & 0 deletions tests/test_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,3 +436,29 @@ def test_reset_event_timer() -> None:
assert not events[1].reset_event_timer
assert events[2].reset_event_timer
assert not events[3].reset_event_timer

events = list(
MDASequence(
stage_positions=[
Position(
x=0,
y=0,
sequence=MDASequence(
channels=["Cy5"], time_plan={"interval": 1, "loops": 2}
),
),
Position(
x=1,
y=1,
sequence=MDASequence(
channels=["DAPI"], time_plan={"interval": 1, "loops": 2}
),
),
]
)
)

assert events[0].reset_event_timer
assert not events[1].reset_event_timer
assert events[2].reset_event_timer
assert not events[3].reset_event_timer
Loading