feat(hamilton): add configurable STAR chatterbox state - #1231
Open
VivienP wants to merge 1 commit into
Open
Conversation
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.
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.
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_status→request_iswap_initialization_status()(defaultTrue)channel_z_positions→request_z_pos_channel_n()(default285.0mm)dispensing_drive_positions→channel_dispensing_drive_request_position()(default0.0)Why per-instance typed state
A
mock_responseparameter on every query would diverge chatterbox signatures fromSTARBackendand would not give a stable reading across a multi-step protocol.STARChatterboxStateis bound per backend instance, copied into tuples, and replaced wholesale throughbackend.chatterbox_state.Backward compatibility
STARChatterboxBackend()keeps the current unconfigured replies.STARBackendis unchanged.channel_dispensing_drive_request_position(..., simulated_value=None)remains source-compatible for existing callers; an explicitsimulated_value=0.0is distinct from an omitted argument.One source of truth (excluded)
TipTrackerNon-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
STARChatterboxStatetests (defaults, isolation, copies, invalid lengths, index checks, replacement,setup()preservation,simulated_value=0.0vs omitted, tracker/LLD ownership)ruff check pylabrobotruff format --check pylabrobotmypy pylabrobotgit diff --checkLocal Sphinx dummy
-Won Windows reports 11 pre-existing autosummary stub warnings from case-insensitive plate alias collisions (BioRad_*vsbiorad_*, etc.).simulation.mditself built without warnings. CI docs-check runs on Ubuntu.