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: fix skip channel in iter_sequence + tests #85

Merged
merged 4 commits into from
Mar 20, 2023

Conversation

fdrgsp
Copy link
Contributor

@fdrgsp fdrgsp commented Mar 13, 2023

This PR fixes a bug in the MDASequence iter_sequence method and adds more tests.

Currently, if we run a sequence with multiple channels and a grid_plan (or z_plan or time_plan) in a position sequence (like the one below), we get ONLY ONE channel through the sequence:

mda = MDASequence(
    channels=[
        {"config": "Cy5", "exposure": 10},
        {"config": "FITC", "exposure": 10}
    ],
    stage_positions=[
        {"x": 0, "y": 0, "sequence": {"grid_plan": {"rows": 2, "columns": 1}}}
    ]
)

running:

for e in mda:
    print(e.index)

current output:

{"p": 0, "c": 0, "g": 0}
{"p": 0, "c": 0, "g": 1}

with this fix, we get both the channels as expected:

{"p": 0, "c": 0, "g": 0}
{"p": 0, "c": 0, "g": 1}
{"p": 0, "c": 1, "g": 0}
{"p": 0, "c": 1, "g": 1}

@codecov
Copy link

codecov bot commented Mar 13, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (3a737f9) 96.11% compared to head (3f37c3a) 96.11%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #85   +/-   ##
=======================================
  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%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@fdrgsp fdrgsp requested a review from tlambert03 March 13, 2023 20:07
@tlambert03 tlambert03 merged commit 10e485d into pymmcore-plus:main Mar 20, 2023
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.

2 participants