Open
Conversation
Decomposes the monolithic legacy NimbusBackend into the three-layer v1b1 architecture matching the STAR port: - Nimbus(Device): user-facing class, wires PIP capability frontend - NimbusDriver(HamiltonTCPHandler): TCP communication, hardware discovery - NimbusPIPBackend(PIPBackend): pipetting operations (pick_up/drop/asp/disp) - NimbusDoor: door control subsystem (follows STARCover pattern) - NimbusChatterboxDriver: simulation driver for testing without hardware Also promotes the shared Hamilton TCP protocol layer from legacy to pylabrobot/hamilton/tcp/ and converts legacy TCP submodules to thin re-export shims (eliminating ~2,470 lines of duplication). The legacy NimbusBackend is now a thin wrapper that delegates all pipetting operations to NimbusPIPBackend and door operations to NimbusDoor, maintaining the exact same API. All 157 legacy tests pass and run through the new v1b1 code (verified via call tracing). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add early return for empty ops in pick_up_tips/drop_tips/aspirate/dispense - Add channel bounds check in _fill_by_channels - Add _ensure_deck() calls in pick_up_tips, drop_tips, _initialize_smart_roll - Fix Nimbus.stop() guard on _setup_finished (safe double-stop) - Fix Nimbus.setup() to clean up driver on partial failure (connection leak) - Fix version_bite typo -> version_byte in packets.py - Add actual logger.warning for protocol version mismatch (was silent pass) - Fix incorrect port docstring in tcp_base.py Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Ports the legacy Hamilton Nimbus integration to the v1b1 Device/Driver/Backend architecture by extracting a shared Hamilton TCP protocol layer into pylabrobot/hamilton/tcp/ and converting the legacy TCP modules into compatibility shims, while introducing a new Nimbus driver/device stack.
Changes:
- Promotes the Hamilton TCP protocol/packet/message/command/introspection stack into
pylabrobot/hamilton/tcp/and replaces legacy implementations with thin re-export shims. - Adds a reusable
HamiltonTCPHandlerbase driver plus a newNimbusDriver,Nimbusdevice,NimbusPIPBackend, and door/chatterbox subsystems. - Updates legacy Nimbus backend tests to set up new v1b1 delegates in the legacy wrapper’s test scaffolding.
Reviewed changes
Copilot reviewed 21 out of 24 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pylabrobot/legacy/liquid_handling/backends/hamilton/tcp/protocol.py | Replaced legacy protocol constants/enums with re-export shim to new canonical module. |
| pylabrobot/legacy/liquid_handling/backends/hamilton/tcp/packets.py | Replaced packet structures with re-export shim to new canonical module. |
| pylabrobot/legacy/liquid_handling/backends/hamilton/tcp/messages.py | Replaced message builders/parsers with re-export shim to new canonical module. |
| pylabrobot/legacy/liquid_handling/backends/hamilton/tcp/introspection.py | Replaced introspection API with re-export shim to new canonical module. |
| pylabrobot/legacy/liquid_handling/backends/hamilton/tcp/commands.py | Replaced command base class with re-export shim to new canonical module. |
| pylabrobot/legacy/liquid_handling/backends/hamilton/tcp/init.py | Added legacy-package re-exports pointing at new canonical TCP layer. |
| pylabrobot/legacy/liquid_handling/backends/hamilton/nimbus_backend_tests.py | Adjusted test scaffolding to initialize legacy wrapper delegates using new v1b1 components. |
| pylabrobot/hamilton/tcp/tests/init.py | Adds test package marker for the new TCP layer. |
| pylabrobot/hamilton/tcp/protocol.py | New canonical protocol constants/enums for Hamilton TCP instruments. |
| pylabrobot/hamilton/tcp/packets.py | New canonical packet encode/decode structures for Hamilton TCP. |
| pylabrobot/hamilton/tcp/messages.py | New canonical message builders/parsers and HOI parameter encoding/parsing. |
| pylabrobot/hamilton/tcp/introspection.py | New canonical introspection API and command set for runtime discovery. |
| pylabrobot/hamilton/tcp/commands.py | New canonical HamiltonCommand base class for the refactored stack. |
| pylabrobot/hamilton/tcp/init.py | Public re-exports for the new Hamilton TCP protocol layer. |
| pylabrobot/hamilton/liquid_handlers/tcp_base.py | Introduces HamiltonTCPHandler base driver implementing setup/init/registration/discovery and command execution. |
| pylabrobot/hamilton/liquid_handlers/nimbus/tests/init.py | Adds Nimbus v1b1 test package marker. |
| pylabrobot/hamilton/liquid_handlers/nimbus/pip_backend.py | Implements Nimbus-specific PIP backend translating PIP ops into Nimbus firmware commands. |
| pylabrobot/hamilton/liquid_handlers/nimbus/nimbus.py | Adds user-facing Nimbus(Device) wiring driver + PIP capability. |
| pylabrobot/hamilton/liquid_handlers/nimbus/driver.py | Adds NimbusDriver on top of HamiltonTCPHandler with Nimbus object discovery and subsystem wiring. |
| pylabrobot/hamilton/liquid_handlers/nimbus/door.py | Adds NimbusDoor subsystem for door lock operations. |
| pylabrobot/hamilton/liquid_handlers/nimbus/commands.py | Adds Nimbus command classes and helpers for firmware method calls. |
| pylabrobot/hamilton/liquid_handlers/nimbus/chatterbox.py | Adds simulation driver that logs commands and returns canned responses. |
| pylabrobot/hamilton/liquid_handlers/nimbus/init.py | Exposes Nimbus v1b1 public API surface via package exports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pylabrobot/legacy/liquid_handling/backends/hamilton/nimbus_backend_tests.py
Outdated
Show resolved
Hide resolved
- Fix string_array parser to honor count prefix (encoder was correct, parser was not reading the u32 count — now they match) - Enforce per-call timeout in send_command via asyncio.wait_for - Validate host is provided when chatterbox=False in Nimbus.__init__ - Replace type: ignore with assert in test helper for type safety Co-Authored-By: Claude Opus 4.6 (1M context) <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.
Summary
NimbusBackend(2312 lines) into the three-layer v1b1 Device/Driver/Backend architecture matching the STAR portpylabrobot/hamilton/tcp/and converts legacy submodules to thin re-export shims (~2,470 lines of duplication eliminated)NimbusBackendbecomes a thin wrapper delegating to the new code while maintaining the exact same APINew files
nimbus/nimbus.pyNimbus(Device)nimbus/driver.pyNimbusDriver(HamiltonTCPHandler)nimbus/pip_backend.pyNimbusPIPBackend(PIPBackend)nimbus/commands.pynimbus/door.pyNimbusDoornimbus/chatterbox.pyNimbusChatterboxDriverliquid_handlers/tcp_base.pyHamiltonTCPHandler(Driver)hamilton/tcp/*.pyTest plan
Address is LegacyAddress)Nimbus(deck, chatterbox=True)setup/stop works🤖 Generated with Claude Code