Skip to content

fix: handle generator-based MDA sequences without crashing#364

Merged
tlambert03 merged 3 commits intopymmcore-plus:mainfrom
hinderling:fix/generator-mda
Feb 15, 2026
Merged

fix: handle generator-based MDA sequences without crashing#364
tlambert03 merged 3 commits intopymmcore-plus:mainfrom
hinderling:fix/generator-mda

Conversation

@hinderling
Copy link
Collaborator

@hinderling hinderling commented Feb 10, 2026

Summary

  • Generator sequences (from mmc.run_mda(my_generator())) have unknown shape and previously crashed the MDA handler when it tried to pre-allocate zarr layers
  • _on_mda_started now detects GeneratorMDASequence and skips layer creation
  • _on_mda_frame forwards generator frames to the preview layer so acquired images remain visible
  • Adds PixelSizeWidget deprecation warning filter for tests

Generator sequences (e.g. from `mmc.run_mda(my_generator())`) have
unknown shape and cannot pre-allocate zarr layers. The handler now
detects GeneratorMDASequence in _on_mda_started and skips layer
creation, and _on_mda_frame forwards generator frames to the preview
layer so they remain visible.

Also adds a PixelSizeWidget deprecation warning filter for tests.
@tlambert03
Copy link
Member

any changes you want to make here are fine with me @hinderling ... as you know, we don't focus on napari too much anymore. But I do want to keep it working and I appreciate your eyes on it. I just sent you an invite to be a maintainer of this repo (write+ access), and would welcome any modifications you want to make (still through PRs though)

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.72%. Comparing base (c7e8f1e) to head (a0872c3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #364      +/-   ##
==========================================
+ Coverage   78.25%   78.72%   +0.47%     
==========================================
  Files          13       13              
  Lines         630      644      +14     
==========================================
+ Hits          493      507      +14     
  Misses        137      137              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tlambert03
Copy link
Member

can you change all the macos-13 runners to macos-15-intel?

The mypy pre-commit environment with pymmcore_plus exceeds the
pre-commit.ci 250MiB tier limit due to tensorstore (~46MB).
Skip mypy on pre-commit.ci and run it as a dedicated CI job instead,
where it has access to the full dependency tree with no size limit.
@hinderling
Copy link
Collaborator Author

skipped mypy in pre-commit because it exceeded the 250MB limit (mainly numpy/tensorstore deps from pymmcore-plus), instead added it to the workflow.

@tlambert03
Copy link
Member

ready for merge right? (that failing test is probably unrelated... but we'll need to fix/ignore it before release)

@hinderling
Copy link
Collaborator Author

yes seems unrelated! ready to merge from my side

@tlambert03 tlambert03 merged commit ab83ba0 into pymmcore-plus:main Feb 15, 2026
55 of 58 checks passed
@hinderling hinderling deleted the fix/generator-mda branch February 15, 2026 17:02
@tlambert03
Copy link
Member

just pushed tag for v0.2.0 ... let me know if it doesn't make it to PyPI :)

@hinderling
Copy link
Collaborator Author

thank you talley!

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

Comments