Skip to content

Fix well index decoding in Imager.capture for Well objects - #1226

Open
hinderling wants to merge 1 commit into
PyLabRobot:mainfrom
hinderling:fix-imager-well-index
Open

Fix well index decoding in Imager.capture for Well objects#1226
hinderling wants to merge 1 commit into
PyLabRobot:mainfrom
hinderling:fix-imager-well-index

Conversation

@hinderling

Copy link
Copy Markdown

Plate items are ordered column-major (A1, B1, ..., H1, A2, ...), but capture() decoded a well's index with divmod(idx, num_items_x), which mis-addresses wells: capture(well=plate.get_well("B2")) images A10 on a 96-well plate, while the equivalent capture(well=(1, 1)) images B2.

Fix: Use the get_child_row/get_child_column accessors instead of hand-decoding the index, so the resolution no longer depends on item ordering at all. Adds a regression test.

Plate items are ordered column-major (A1, B1, ..., H1, A2, ...), but capture()
decoded a Well's index with divmod(idx, num_items_x), which mis-addresses wells
on non-square plates: capture(well=plate.get_well("B2")) images A10 on a
96-well plate, while the equivalent capture(well=(1, 1)) images B2.

Resolve the well with the get_child_row/get_child_column accessors instead of
hand-decoding the index, so resolution does not depend on item ordering.
Adds a regression test.
@hinderling
hinderling force-pushed the fix-imager-well-index branch from d141f79 to e1971dd Compare August 28, 2026 15:08
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