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: retain WellPlatePlan type when used for MDASequence.stage_positions #190

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

tlambert03
Copy link
Member

make sure that passing a WellPlatePlan to MDASequence.stage_positions retains the proper type. Useful for pymmcore-plus/pymmcore-widgets#362

This commit refactors the `_validate_stage_positions` method in the `MDASequence` class to improve the validation process for the `stage_positions` field. The method now checks if the value is an instance of `np.ndarray` and handles it accordingly. Additionally, it adds support for validating a `WellPlatePlan` object as the `stage_positions` value. The commit also includes a new test case in `test_well_plate.py` to ensure that the `stage_positions` field in `MDASequence` correctly handles a `WellPlatePlan` object.

Fixes #XYZ
@tlambert03 tlambert03 changed the title refactor: improve validation for stage_positions in MDASequence fix: retain WellPlatePlan type when used for MDASequence.stage_positions Oct 1, 2024
@tlambert03 tlambert03 enabled auto-merge (squash) October 1, 2024 18:38
Copy link

codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.77%. Comparing base (dea132e) to head (b195872).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #190      +/-   ##
==========================================
+ Coverage   93.67%   93.77%   +0.10%     
==========================================
  Files          18       18              
  Lines        1233     1237       +4     
==========================================
+ Hits         1155     1160       +5     
+ Misses         78       77       -1     

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

@tlambert03 tlambert03 merged commit f689e06 into pymmcore-plus:main Oct 1, 2024
25 of 26 checks passed
@tlambert03 tlambert03 deleted the fix-stage_position-type branch October 1, 2024 18:39
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.

1 participant