Make STARBackend.probe_liquid_heights() Smart#876
Open
BioCam wants to merge 12 commits intoPyLabRobot:mainfrom
Open
Make STARBackend.probe_liquid_heights() Smart#876BioCam wants to merge 12 commits intoPyLabRobot:mainfrom
STARBackend.probe_liquid_heights() Smart#876BioCam wants to merge 12 commits intoPyLabRobot:mainfrom
Conversation
…on methods important for usage in... 1.- LLD (based on these inner detection methods rather than the default aspirate) 2.- auto-liquid level following
useful for pooling (?)
i.e. channels not used in between those that are used in spread behaviour across large
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the probe_liquid_heights() method to automatically handle complex channel and container configurations that previously required manual batching or raised errors. The changes enable the method to intelligently group containers by X position, partition channels into compatible Y sub-batches, compute channel-aware offsets for non-consecutive channel configurations, and provide fine-grained Z-axis control during probing operations.
Changes:
- Added automatic X-position grouping and Y sub-batching to handle any channel/container configuration
- Implemented channel-index-aware offset calculation for non-consecutive channels (e.g., [0,1,2,5,6,7])
- Added three new traverse height parameters and a flag to control Z positioning at different stages
- Added duplicate channel validation with an override flag for legitimate multi-probe scenarios
- Exposed all cLLD and pLLD detection parameters as method arguments
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The Problem
probe_liquid_heightshad several limitations that prevented it from handling real-world channel/container configurations:NotImplementedError, even though the method could handle them sequentially.channels like
[0,1,2,5,6,7]were spaced as if they were[0,1,2,3,4,5], ignoring the physical gap required by phantom intermediate channels (3 and 4). If the container was too small to fit allchannels, this raised an unhandled
ValueErrorinstead of falling back gracefully.members) would raise errors mid-command instead of being automatically partitioned into compatible batches.
This PR
Makes
probe_liquid_heights"smart" 🤓, i.e. automatically handle any channel/container configuration:channel index difference. Phantom channels between non-consecutive batch members are explicitly positioned at minimum spacing to prevent firmware errors. Each sub-batch is probed in parallel.
get_wide_single_resource_liquid_op_offsets, then only the actual channel offsets are kept. Channels like[0,1,2,5,6,7]now correctly fit in one batch. If the container is too small, offsets fallback to center and Y sub-batching automatically serializes the channels that can't coexist.
move_to_z_safety_afterflag allows skipping the final Z raiseentirely. On any error, all channels return to full Z safety regardless of these settings.
min_traverse_height_at_beginning_of_commandNone→ full Z safetymin_traverse_height_during_commandNone→ full Z safetyz_position_at_end_of_commandNone→ full Z safetymove_to_z_safety_afterTrueFalseallow_duplicate_channels— defaults toFalsewith a clear error message;aspirate/dispensepassTruesince they may legitimately probe the same container multiple times.No breaking changes — single-X, consecutive-channel usage produces identical behavior.
Pseudocode: full method flow