STARBackend: forward traverse-height and grouping knobs through probe_liquid_volumes#1146
Merged
Merged
Conversation
…obe_liquid_volumes` `probe_liquid_volumes` is a thin wrapper: it calls `probe_liquid_heights` and converts each returned height to a volume via `compute_volume_from_height`. But it forwarded only a subset of the inner method's knobs, so it silently overrode two probe behaviours that a direct `probe_liquid_heights` call can control. `probe_liquid_heights` exposes `min_traverse_height_at_beginning_of_command`, `min_traverse_height_during_command`, and `x_grouping_tolerance`; `probe_liquid_volumes` did not, so its inner call always fell back to full Z safety between batches (channels fully retract each pass, slower) and default X grouping, with no way to request a low on-deck traverse. - `probe_liquid_volumes` now accepts and forwards `min_traverse_height_at_beginning_of_command`, `min_traverse_height_during_command`, and `x_grouping_tolerance`, in the same order as `probe_liquid_heights`. Defaults stay `None`, which reproduces the previous full-Z-safety, default-grouping behaviour. - `lld_mode` widens from `LLDMode` to `Union[LLDMode, List[LLDMode], None]`, default `None`. `None` resolves to GAMMA (capacitive cLLD) inside `probe_liquid_heights`, so both methods default to the same detection mode, and a default call no longer trips the single-`LLDMode` deprecation warning the old `LLDMode.GAMMA` default emitted internally. A per-container list is now accepted too. - `n_replicates` default changes from 3 to 1, matching `probe_liquid_heights`. Behaviour: additive traverse/grouping params and the wider `lld_mode` are behaviour-preserving at their defaults. The one semantic change is `n_replicates`: a default call now takes a single measurement rather than averaging three, and the replicate-consistency check cannot fire at the default. The new params are inserted mid-signature to mirror `probe_liquid_heights`, so a caller passing `z_position_at_end_of_command` or `move_to_z_safety_after` positionally would misbind; there are no such call sites in-tree, and these APIs are used with keyword arguments. Tests: the `probe_liquid_heights` suite passes unchanged; `ruff format`, `ruff check`, `ruff check --select I`, and `mypy --check-untyped-defs` are clean on the backend. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015TDaTwWeE6RniECBUHZQnv
…or auto-selection `probe_liquid_heights` accepts `use_channels=None` and auto-selects channels [0, 1, ..., len(containers)-1] via `validate_channel_selections`; `probe_liquid_volumes` required an explicit list purely for historical reasons - it predates that auto-selection, and its callee already handles `None` identically for volume probing. - `use_channels` on `probe_liquid_volumes` becomes `Optional[List[int]] = None`, forwarded unchanged. This is a required->optional widening, so existing callers are unaffected. The two signatures are now identical: `probe_liquid_volumes` is a pure pass-through to `probe_liquid_heights` plus the `compute_volume_from_height` conversion. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015TDaTwWeE6RniECBUHZQnv
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.
probe_liquid_volumes is a thin wrapper: it calls probe_liquid_heights and converts each returned height to a volume via compute_volume_from_height. But it forwarded only a subset of the inner method's knobs, so it silently overrode two probe behaviours that a direct probe_liquid_heights call can control, and it required an explicit use_channels the inner method makes optional.
probe_liquid_heights exposes min_traverse_height_at_beginning_of_command, min_traverse_height_during_command, and x_grouping_tolerance; probe_liquid_volumes did not, so its inner call always fell back to full Z safety between batches (channels fully retract each pass, slower) and default X grouping, with no way to request a low on-deck traverse.
With these changes the two signatures are identical, and probe_liquid_volumes is a pure pass-through to probe_liquid_heights plus the compute_volume_from_height conversion.
Behaviour: the additive traverse/grouping params, the wider lld_mode, and the optional use_channels are all behaviour-preserving at their defaults. The one semantic change is n_replicates: a default call now takes a single measurement rather than averaging three, and the replicate-consistency check cannot fire at the default. The new traverse/grouping params are inserted mid-signature to mirror probe_liquid_heights, so a caller passing z_position_at_end_of_command or move_to_z_safety_after positionally would misbind; there are no such call sites in-tree, and these APIs are used with keyword arguments.
Tests: the probe_liquid_heights suite passes unchanged; ruff format, ruff check, ruff check --select I, and mypy --check-untyped-defs are clean on the backend.
🤖 Generated with Claude Code