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: MDASequence iter_sequence method #93

Merged
merged 2 commits into from
Jul 7, 2023

Conversation

fdrgsp
Copy link
Contributor

@fdrgsp fdrgsp commented Jul 4, 2023

This PR fix a bug in the MDASequence iter_sequence method.

Currently, if we iter through a MDASequence where we specify channels (> 1) in the main sequence and channel(s) + any plan in the sub-sequence like the one below...

mda = MDASequence(
      axis_order="tpgcz",
      channels=["Cy5", "FITC"],
      stage_positions=[{"sequence": {"channels": ["DAPI"], "z_plan": {"range": 2, "step": 1}}}]
)

...we duplicate the number of events (duplication depends on the number of channels that are specified in the main sequence.). This is the current result:

index: {'p': 0, 'c': 0, 'z': 0}  channel: DAPI
index: {'p': 0, 'c': 0, 'z': 1}  channel: DAPI
index: {'p': 0, 'c': 0, 'z': 2}  channel: DAPI
index: {'p': 0, 'c': 0, 'z': 0}  channel: DAPI
index: {'p': 0, 'c': 0, 'z': 1}  channel: DAPI
index: {'p': 0, 'c': 0, 'z': 2}  channel: DAPI

with this fix, we make sure that the the sequence is not executed n times.

index: {'p': 0, 'c': 0, 'z': 0}  channel: DAPI
index: {'p': 0, 'c': 0, 'z': 1}  channel: DAPI
index: {'p': 0, 'c': 0, 'z': 2}  channel: DAPI

@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (03d1b76) 96.11% compared to head (5ae83d3) 96.11%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #93   +/-   ##
=======================================
  Coverage   96.11%   96.11%           
=======================================
  Files          10       10           
  Lines         617      618    +1     
=======================================
+ Hits          593      594    +1     
  Misses         24       24           
Impacted Files Coverage Δ
src/useq/_mda_sequence.py 97.95% <100.00%> (+0.01%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@fdrgsp fdrgsp mentioned this pull request Jul 7, 2023
@tlambert03 tlambert03 merged commit 7486cf9 into pymmcore-plus:main Jul 7, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants