Repository navigation
fix(resources): align a lidded plate on a plate adapter by its wells - #1533
Open
MaxFreedomPollard wants to merge 1 commit into
Open
MaxFreedomPollard wants to merge 1 commit into
MaxFreedomPollard wants to merge 1 commit into
Conversation
PlateAdapter.compute_plate_location builds the plate's well grid from
every child of the plate. A lid is a child too, so its location joins the
well x and y locations, the spacing check sees a step that is not the
well pitch, and the call raises ValueError("well spacing has to be
uniform"). PlateAdapter.assign_child_resource, LiquidHandler.move_plate
and lib.pick_and_place.get_place_location all go through it, so a plate
carrying a lid cannot be put on any plate adapter.
The grid and the well size are read from plate.get_wells().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Problem
A plate that carries a lid cannot be put on a
PlateAdapter:PlateAdapter.compute_plate_locationreads the plate's well grid from every child of the plate (pylabrobot/resources/plate_adapter.py:128-129):A lid is a child of its plate too. On a plate with the same footprint it is seated at x = 0, y = 0, so for the plate in the test below the x locations come out as
[0, 9.5, 18.5, ...]instead of[9.5, 18.5, ...].calculate_well_spacingthen finds a step that is not the well pitch and raises.PlateAdapter.assign_child_resource, the legacyLiquidHandler.move_plateandlib.pick_and_place.get_place_location(used by the v1 STAR and Prep) all callcompute_plate_location. So a lidded plate fails on every plate adapter in the library (Alpaqua MAGNUM FLX, Hamilton 182531 and 188182, Sergi 1047, Thermo MicroAmp base), both when the deck is built and when the plate is moved onto an adapter.Fix
Read the grid from
resource.get_wells(). The well size (lines 145-146) comes from the first of those wells instead of the plate's first child.Tests
TestComputePlateLocation.test_lid_is_not_taken_for_a_wellinplate_adapter_tests.pyworks out where a 96 well plate goes on the adapter, puts a lid on the plate, and checks that the location stays the same. Against the unfixedplate_adapter.pyit fails withValueError: well spacing has to be uniform. With the fix it passes.Verification
cor_96_wellplate_360uL_Fb(with_lid=True)assigned to each of the five plate adapters lands where the same plate without a lid does.LiquidHandler.move_plateof the lidded plate onto the Alpaqua magnet (chatterbox backend, STARlet deck) also works, and so doesget_place_locationfor the same move. Onmainevery one of these raises theValueErrorabove.pylabrobot/visualizer3Dtests (python -m pytest --ignore=pylabrobot/visualizer3D): 5544 passed, 29 skipped, 1365 subtests passed.make lintandmake format-checkwith the pinned ruff 0.15.4: "All checks passed!", "1078 files already formatted".typosreports nothing on the changed files.There is a
CHANGELOG.mdentry under Unreleased / Fixed.🤖 Generated with Claude Code