HamiltonDeck: correct track count & rename rail->track - #1267
Open
BioCam wants to merge 1 commit into
Open
Conversation
A STARlet deck has 30 tracks and a STAR 54, where PyLabRobot counted 32 and 56 - the two extra positions are where the waste block stands. Hamilton also calls the positions tracks, not rails. `num_tracks`, `track=`, `track_to_location` and `track_for_x_coordinate` replace the rails names, which stay as deprecated aliases keeping their old counts and bounds on STAR decks. Positions are unchanged, and decks saved with `num_rails` load where they were. The docs and the legacy `STARBackend` use the new names. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
The STAR v1 integration addresses carriers by track throughout. This lands two corrections to how PyLabRobot describes a Hamilton deck on their own first, so that PR stays smaller.
The problem
PyLabRobot models a STARlet deck with 32 positions and a STAR with 56, but the decks have 30 and 54 tracks. The two extra positions are where the waste block stands, so
rails=31andrails=32were accepted although no carrier can stand there.The positions are also misnamed. Hamilton calls them tracks: the lanes between the slideblocks numbered left to right across the deck, 22.5 mm apart. PyLabRobot calls them rails.
PR Content/Solution
STARLET_NUM_TRACKS = 30andSTAR_NUM_TRACKS = 54, andtrack=onassign_child_resourceis bounded by them.num_tracks,track_to_locationandtrack_for_x_coordinatereplacenum_rails,rails_to_locationandrails_for_x_coordinate. The old names still work and raiseDeprecationWarning; on a STAR decknum_railsandrails=keep the counts and bounds they had.num_tracksis the first argument, wherenum_railswas. A subclass may implement eithertrack_to_locationorrails_to_location, and passing bothnum_tracksandnum_railsraisesValueError.STARBackendmove to the new names.Behaviour: every position is unchanged - track n is at the x rail n was - and decks saved on
mainload with every resource where it was. A deck now serializesnum_tracks, which older versions cannot read, and a count passed positionally toHamiltonSTARDeckis read as tracks.Tests: nine added in
hamilton_deck_tests.py(the new bounds, each deprecated name, a deck saved withnum_rails, a subclass implementing onlyrails_to_location, both counts refused); the 48 existing call sites move totrack=with no expected value changed.ruff format,ruff check --select I,ruff check,typosandmypy pylabrobot --check-untyped-defsare clean; the full suite passes (3261 passed, 4 skipped, 802 subtests).🤖 Generated with Claude Code