Skip to content

v1: hamilton: hold the STAR error definitions once, in star/driver/errors - #1221

Merged
BioCam merged 1 commit into
mainfrom
v1-star-errors
Aug 26, 2026
Merged

v1: hamilton: hold the STAR error definitions once, in star/driver/errors#1221
BioCam merged 1 commit into
mainfrom
v1-star-errors

Conversation

@BioCam

@BioCam BioCam commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

The STAR error definitions - the exception classes, the error-code table and the message tables - live inside the legacy backend, so the v1 driver would have to either import them from pylabrobot.legacy or carry a second copy.

  • moves the 51 exception classes, error_code_to_exception, trace_information_to_string, STARFirmwareError, star_firmware_string_to_error and convert_star_module_error_to_plr_error into pylabrobot/hamilton/star/driver/errors.py
  • the legacy backend imports them from there and keeps every name importable from itself, so existing code is unaffected
  • renames SlaveError to SubsystemError, in its message text as well as its name, and keeps SlaveError as an alias

Behaviour

Unchanged. Every error code maps to the same exception, every message string is the same, and the legacy backend's own error parsing is untouched.

The move is otherwise line-for-line. The one structural change is that the module-name table is now a module-level constant instead of a dictionary rebuilt on each call; its entries are unchanged.

Tests

The existing suite passes unchanged. Equivalence was also checked directly against main: 200 error codes, 2730 module/trace messages, 1323 whole replies and 294 error conversions decode identically, and a simulated protocol covering the channels, the 96-head and the iSWAP emits 480 byte-identical commands.

…/errors`

The exception classes, the error-code table and the message tables lived inside
the legacy backend. Moved to pylabrobot/hamilton/star/driver/errors.py, which
the legacy backend now imports from and re-exports, so the v1 driver does not
have to reach into pylabrobot.legacy or carry a second copy.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@BioCam
BioCam merged commit 69e48b7 into main Aug 26, 2026
21 checks passed
@BioCam
BioCam deleted the v1-star-errors branch August 26, 2026 10:13
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