Skip to content

HamiltonDeck: correct track count & rename rail->track - #1267

Open
BioCam wants to merge 1 commit into
PyLabRobot:mainfrom
BioCam:hamilton-decks-rails-to-track
Open

HamiltonDeck: correct track count & rename rail->track#1267
BioCam wants to merge 1 commit into
PyLabRobot:mainfrom
BioCam:hamilton-decks-rails-to-track

Conversation

@BioCam

@BioCam BioCam commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

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=31 and rails=32 were 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.

Screenshot 2026-09-02 at 12 06 32

PR Content/Solution

  • STARLET_NUM_TRACKS = 30 and STAR_NUM_TRACKS = 54, and track= on assign_child_resource is bounded by them.
  • num_tracks, track_to_location and track_for_x_coordinate replace num_rails, rails_to_location and rails_for_x_coordinate. The old names still work and raise DeprecationWarning; on a STAR deck num_rails and rails= keep the counts and bounds they had.
  • num_tracks is the first argument, where num_rails was. A subclass may implement either track_to_location or rails_to_location, and passing both num_tracks and num_rails raises ValueError.
  • The docs and the legacy STARBackend move to the new names.

Behaviour: every position is unchanged - track n is at the x rail n was - and decks saved on main load with every resource where it was. A deck now serializes num_tracks, which older versions cannot read, and a count passed positionally to HamiltonSTARDeck is read as tracks.

Tests: nine added in hamilton_deck_tests.py (the new bounds, each deprecated name, a deck saved with num_rails, a subclass implementing only rails_to_location, both counts refused); the 48 existing call sites move to track= with no expected value changed. ruff format, ruff check --select I, ruff check, typos and mypy pylabrobot --check-untyped-defs are clean; the full suite passes (3261 passed, 4 skipped, 802 subtests).

🤖 Generated with Claude Code

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>
@BioCam
BioCam requested a review from a team as a code owner September 13, 2026 19:39
@BioCam
BioCam requested a review from rickwierenga September 13, 2026 19:51
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