Skip to content

feat(hamilton): add configurable STAR chatterbox state - #1231

Open
VivienP wants to merge 1 commit into
PyLabRobot:mainfrom
VivienP:feat/star-chatterbox-state
Open

feat(hamilton): add configurable STAR chatterbox state#1231
VivienP wants to merge 1 commit into
PyLabRobot:mainfrom
VivienP:feat/star-chatterbox-state

Conversation

@VivienP

@VivienP VivienP commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements configurable per-instance STAR chatterbox query state, related to #934. Parts of that issue are stale relative to current main: several listed methods are already tracker-backed, LLD-latched, or firmware-path commands rather than hardcoded chatterbox replies.

This PR only configures the remaining category-A hardcoded simulation readings.

Configurable fields

  • iswap_initialization_statusrequest_iswap_initialization_status() (default True)
  • channel_z_positionsrequest_z_pos_channel_n() (default 285.0 mm)
  • dispensing_drive_positionschannel_dispensing_drive_request_position() (default 0.0)

Why per-instance typed state

A mock_response parameter on every query would diverge chatterbox signatures from STARBackend and would not give a stable reading across a multi-step protocol. STARChatterboxState is bound per backend instance, copied into tuples, and replaced wholesale through backend.chatterbox_state.

Backward compatibility

STARChatterboxBackend() keeps the current unconfigured replies. STARBackend is unchanged. channel_dispensing_drive_request_position(..., simulated_value=None) remains source-compatible for existing callers; an explicit simulated_value=0.0 is distinct from an omitted argument.

One source of truth (excluded)

  • Tip presence, 96-head tip presence, and tip length stay on TipTracker
  • Last LLD heights stay latched by simulated LLD
  • Parked flags stay on existing backend latch state
  • Machine / extended / iSWAP factory configuration stay on their existing objects
  • Carrier-presence and CoRe resource-existence commands still follow the firmware path

Non-goals

This is simulated query state, not physical evidence. It is not a physics simulator and not a fault-injection framework. Motion commands do not update these readings.

Test plan

  • STAR tests
  • generic chatterbox tests
  • STARChatterboxState tests (defaults, isolation, copies, invalid lengths, index checks, replacement, setup() preservation, simulated_value=0.0 vs omitted, tracker/LLD ownership)
  • LiquidHandler tests
  • TipTracker tests
  • ruff check pylabrobot
  • ruff format --check pylabrobot
  • mypy pylabrobot
  • git diff --check

Local Sphinx dummy -W on Windows reports 11 pre-existing autosummary stub warnings from case-insensitive plate alias collisions (BioRad_* vs biorad_*, etc.). simulation.md itself built without warnings. CI docs-check runs on Ubuntu.

Per-instance STARChatterboxState lets STAR simulation return deterministic query values for protocol and recovery tests without subclassing. Only hardcoded chatterbox readings are configurable: iSWAP initialization, channel Z, and dispensing-drive position.

TipTracker, latched LLD, parked flags, and machine/factory configuration stay the source of truth. Bound channel vectors are tuples; replace backend.chatterbox_state to change values. simulated_value=None distinguishes an explicit 0.0 override from an omitted argument.
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