feat: Add plate_row/col to PositionBase#269
Merged
Merged
Conversation
Add serialized int fields to PositionBase for annotating which well a position belongs to, enabling HCS zarr output from plain stage positions without requiring WellPlatePlan. Also populate these fields in WellPlatePlan.all_well_positions and selected_well_positions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add serialized int fields to PositionBase for annotating which well a position belongs to, enabling HCS zarr output from plain stage positions without requiring WellPlatePlan. Also populate these fields in WellPlatePlan.all_well_positions and selected_well_positions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a `name_pattern` field to `_GridPlan` that controls how grid
positions are named. Supports {row}, {col}, {idx} format variables.
Default is "{idx:04d}" (preserves backward compat). Names are now
generated in useq-schema so downstream consumers don't need to
override them.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- If name is None but plate_row/plate_col are set, auto-generate
a well name using existing _index_to_row_name (e.g., 0,0 -> "A1")
- When iterating with a grid plan, compose pos_name as
"{position_name}_{grid_name}" for plate positions (e.g., "A1_0000")
- Explicit names are never overwritten
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When plate_row and plate_col are set, the position name is always derived from them (e.g., plate_row=0, plate_col=0 -> "A1"). Providing an explicit name that doesn't match raises ValueError. This ensures the position name and zarr well path are always coupled. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
plate_row accepts 0-based int (0 -> "A") or str ("A").
plate_col accepts 0-based int (0 -> "1") or str ("1").
The well name is derived accordingly and validated against
any explicit name provided.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…pos_name 26 new tests covering: - Name auto-generation from int and str plate_row/plate_col - Mismatched name validation (ValueError) - JSON and YAML serialization round-trips - Propagation through Position.__add__ - WellPlatePlan setting plate_row/plate_col on positions - Grid name_pattern (default, custom, serialization) - Composite MDAEvent.pos_name for plate positions with grid Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When plate_row and plate_col are both int (standard well-plate indices), the name is strictly derived (e.g., 0,0 -> "A1") and mismatches raise ValueError. When either is a str (custom naming like "fish0", "neuromast0"), any explicit name is accepted, allowing free-form naming for non-standard plate layouts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use inline isinstance checks instead of a variable so mypy can narrow int|str to int within the branch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…schema into add-plate-row-col
…e and related classes
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (84.61%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #269 +/- ##
==========================================
- Coverage 93.69% 93.62% -0.07%
==========================================
Files 33 33
Lines 2568 2590 +22
==========================================
+ Hits 2406 2425 +19
- Misses 162 165 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this is a subset of #268
It pulls out the addition of plate_row/plate_col to PositionBase accepting only
int | None(not strings), and doesn't do anything with naming for now... continuing to leave that concern to the downstream/application levelThis also, renames Position row/col to
grid_row/grid_col(with deprecated backwards compatible accessors) and removes the "excluded from serialization" flag that they used to have (i can't remember why I did that, but it was probably aesthetic and not well principled)