feat: add dispensing module with Formulatrix Mantis backend#987
Open
xbtu2 wants to merge 6 commits intoPyLabRobot:v1b1from
Open
feat: add dispensing module with Formulatrix Mantis backend#987xbtu2 wants to merge 6 commits intoPyLabRobot:v1b1from
xbtu2 wants to merge 6 commits intoPyLabRobot:v1b1from
Conversation
Add a new pylabrobot/dispensing/ module for chip-based contactless liquid dispensers, following PLR's Machine/Backend architecture pattern. New module structure: - Dispenser front-end (Machine subclass) - DispenserBackend ABC with setup/stop/dispense interface - DispenseOp frozen dataclass for operation parameters - ChatterboxBackend for device-free testing Mantis backend (pylabrobot/dispensing/mantis/): - MantisBackend implementing DispenserBackend - FmlxDriver for Formulatrix FMLX protocol over FTDI - MantisKinematics (inverse/forward kinematics for dual-arm SCARA) - MantisMapGenerator (homography-corrected plate coordinate mapping) - Sequence file parser for Mantis .seq files - Constants with proper IntFlag/IntEnum types 28 unit tests (all passing).
Member
|
sweet! thanks for the PR! mind if I rebase this onto the v1b1 architecture? |
- Fix isort I001: remove extra blank line in mantis_sequence_parser.py - Fix mypy arg-type: use explicit MantisMapGenerator construction instead of **dict unpacking (rows/cols need int, not float) - Fix mypy arg-type: cast coord dict values to float explicitly - Fix mypy no-any-return: cast dict.get() results to int in motor status helpers - Change get_well_coordinate return type from Dict[str, object] to Dict[str, Any] for correct downstream typing - Add 'Occured' to _typos.toml (firmware protocol string, not a typo)
Member
|
right now the plate layout is loaded from DEFAULT_PLATE_GEOMETRY, can we load it from the associated plate instead? this way we can use our existing definitions and also automatically make it work for non 96 well for plates |
Collaborator
Contributor
Author
Drops DEFAULT_PLATE_GEOMETRY and the plate_geometry backend kwarg in favor of computing each well's machine coordinate from its PLR Plate parent. PLR stores wells as LFB with A1 at the back; the Mantis plate frame has A1 at the front, so y is mirrored across plate.size_y before the stage homography is applied. Dispense Z is kept as an explicit backend-level calibration (dispense_z) since it is a machine property, not a plate property. MantisMapGenerator's row/pitch/A1 template is now dead — collapsed to a free apply_stage_homography() function. Junk tests that only checked types or counted loop iterations are removed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… category Removes the dispensing category abstraction (Dispenser frontend, DispenserBackend, DispenseOp, chatterbox) and moves the Mantis backend under a top-level formulatrix vendor directory. MantisBackend now inherits from MachineBackend directly and dispense() takes (wells, volume, chip) instead of a list of DispenseOps. The per-op chip grouping is gone since the old frontend never allowed mixed chips per call. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a new diaphragm bulk-dispensing capability under
pylabrobot.capabilities.bulk_dispensers.diaphragm. This is the
"variable" head-format variant: callers pass parallel containers and
volumes lists. The capability validates lengths and positivity; chip
number, dispense Z-height, and prime volume travel as a BackendParams
subclass on each backend implementation. Includes a chatterbox backend
for device-free testing.
Splits the Mantis backend into the v1b1 three-layer shape:
* MantisDriver(Driver) — FTDI/FMLX connection, init sequence, motion,
chip lifecycle, raw PPI playback, pressure init/shutdown.
* MantisDiaphragmDispenserBackend(DiaphragmDispenserBackend) —
translates capability ops into driver calls, applies the PLR -> Mantis
y-flip + stage homography, exposes nested DispenseParams / PrimeParams.
* Mantis(Device) — wires the driver and capability together as the
first backend of the new diaphragm capability.
Adds user-guide walkthroughs for both the diaphragm capability and the
Mantis hello-world, plus API rst pages. Models bulk dispensing as a
mechanism × head-format matrix in the docs so future variable / 8 / 96
variants of each mechanism have a clear naming and structural slot.
Drive-by fixes:
* docs/api/pylabrobot.capabilities.rst: corrected stale currentmodule
paths for peristaltic/syringe (.peristaltic -> .peristaltic8,
.backend -> .backend8) — autosummary was failing to import these,
which also blocked the {class} cross-references in user-guide pages.
* docs/user_guide/hamilton/star/index.md: fixed pre-existing toctree
refs to nonexistent y-probing/z-probing pages (now point at the
actual probing/{x,y,z}.ipynb files from the v1b1 merge).
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
Adds a new
pylabrobot/dispensing/module for chip-based contactless liquid dispensers, following PLR's Machine/Backend architecture pattern. The Formulatrix Mantis is the first backend implementation.New Module Structure
Design Highlights
Dispenser(Machine)front-end with@need_setup_finisheddecoratorDispenserBackendABC withsetup(),stop(),dispense(ops)interfaceDispenseOpfrozen dataclass (resource, volume, chip)MantisBackend— full init sequence, chip lifecycle (attach/prime/dispense/detach), pressure controlFmlxDriver— accepts PLR'spylabrobot.io.ftdi.FTDIvia dependency injectionMotorStatusCode(IntFlag)witherror_mask(), PEP 8 namingchip_type_mapper instrument instanceUsage Example
Testing
All pre-commit hooks pass (ruff format, ruff check, typos).