Add BioTek EL406 plate washer backend#878
Open
tfehlmann wants to merge 12 commits intoPyLabRobot:mainfrom
Open
Add BioTek EL406 plate washer backend#878tfehlmann wants to merge 12 commits intoPyLabRobot:mainfrom
tfehlmann wants to merge 12 commits intoPyLabRobot:mainfrom
Conversation
Add a new plate washing module with a backend for the BioTek EL406 plate washer, communicating via FTDI USB serial interface. Architecture: - PlateWasher resource and PlateWasherBackend base class - BioTekEL406Backend composed from mixins: Communication, Queries, Actions, and Steps (manifold, peristaltic, syringe, shake) - Binary protocol with framed messages, ACK/NAK flow control, and async status polling for long-running operations Features: - Manifold wash/dispense/aspirate/prime/auto-clean operations - Peristaltic pump prime/dispense/purge with column/row selection - Syringe pump dispense/prime with column selection - Plate shaking with configurable intensity and duration - Device queries (manifold type, serial number, sensor status) - Action commands (abort, pause, resume, reset, self-check) - 160+ device error codes with descriptive messages - MockFTDI test double for hardware-free testing 374 tests covering all operations, wire format encoding, parameter validation, communication protocol, and error handling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f9b25f5 to
4b77208
Compare
setup() now resets the instrument and starts batch mode automatically, so users can issue step commands immediately. stop() runs cleanup_after_protocol before disconnecting. Both can be skipped via skip_reset and skip_cleanup flags, following codebase conventions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extract EL406TestCase base class into mock_tests.py with shared setUp/tearDown, eliminating duplicated boilerplate across all test files - Patch asyncio.sleep in tests so hardware delays don't slow mock tests - Replace hardcoded timeouts (5.0, 2.0) in communication.py with self.timeout so the configured value is used consistently - Timeout-specific tests set backend.timeout = 0.01 to test the path fast Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move asyncio.Lock() from __init__ to setup() so it's created inside a running event loop (required on Python 3.9). Increase mock buffer sizes and refill buffer before tearDown's stop() so cleanup commands don't starve. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Convert all public-facing parameters to PLR standard units (µL for volume, seconds for time) with internal conversion at the API boundary. Add unit suffixes (_ms, _min, _ml) to internal builder params that use wire-format units, so the unit mismatch is always explicit in code. Also add ValueError for minute-resolution params not divisible by 60, and clean up test boundary values and comments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace manual bytes([...]) construction, bit manipulation (value & 0xFF, (value >> 8) & 0xFF), and helpers (encode_volume_16bit, encode_signed_byte) with Writer's fluent API (w.u8().u16().i8().finish()) across all 9 command builders and build_framed_message. Absorb _encode_wash_byte_values into _build_wash_composite_command. Remove now-dead encode_volume_16bit and encode_signed_byte helpers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace manual LE u16 parsing (data[i] | (data[i+1] << 8)) with Reader.u16() in communication.py for header data-length, command echo, and poll state fields. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Validation functions that were only used in one file now live there instead of in helpers.py. Wire-format range checks (offset_xy, offset_z, num_pre_dispenses) removed — the binary Writer will enforce those. validate_volume inlined at call sites. validate_intensity moved to _shake.py since intensity is a shake concept. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The build command methods already document wire format and byte layout. Strip repeated protocol specs from test class/method docstrings and inline comments across all test files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Inline single-use command codes with keyword arguments across all files - Move LONG_READ_TIMEOUT to communication.py (used by communication, queries, actions) - Inline DEFAULT_READ_TIMEOUT (15.0) in backend.py - Inline ACK_BYTE/NAK_BYTE as 0x06/0x15 in communication.py - Inline MSG_* protocol constants in protocol.py - Inline VALID_* sets into their validation functions - Inline syringe limit constants into validators - Remove constants re-exports from __init__.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- syringe_to_byte → _syringe.py - cassette_to_byte, encode_quadrant_mask_inverted → _peristaltic.py - columns_to_column_mask, encode_column_mask → protocol.py - TRAVEL_RATE_TO_BYTE, travel_rate_to_byte → _manifold.py - INTENSITY_TO_BYTE → _shake.py (manifold imports from there) - get_plate_type_wash_defaults → _manifold.py - helpers.py now only has plate type defaults and lookup functions Co-Authored-By: Claude Opus 4.6 <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
pylabrobot.plate_washingmodule withPlateWasherresource andPlateWasherBackendbase classBioTekEL406Backendfor the BioTek EL406 plate washer, communicating via FTDI USB serialSupported operations
Architecture
MockFTDItest double enables hardware-free testingPlateReader/PlateReaderBackendhierarchy)Test plan
pytest pylabrobot/plate_washing/biotek/)🤖 Generated with Claude Code