Skip to content

Mix: add optional surface_following_distance#1085

Merged
BioCam merged 1 commit into
PyLabRobot:mainfrom
BioCam:mix-surface-following-distance
Jun 11, 2026
Merged

Mix: add optional surface_following_distance#1085
BioCam merged 1 commit into
PyLabRobot:mainfrom
BioCam:mix-surface-following-distance

Conversation

@BioCam

@BioCam BioCam commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Adds an optional surface_following_distance (mm) to Mix. On liquid handlers whose firmware drives Z in parallel with the piston during a mix (e.g. the Hamilton STAR), following the surface as the level changes is an essential part of a good in-place mix. Backends without that capability ignore the field; the default None means no surface following.

This is the same shape as other capability-dependent parameters in PyLabRobot - for example a plate reader exposing a reading mode (orbital shaking, a given wavelength range) that some models support and others don't. The protocol states the intent once; backends that can honour it do, and those that can't ignore it, rather than the protocol branching per device.

Backward compatible: optional with a default, so existing Mix(volume, repetitions, flow_rate) construction and serialization are unchanged. No backend behaviour changes in this PR - it just adds the parameter to the shared vocabulary so supporting backends can consume it.

@BioCam BioCam requested a review from rickwierenga June 10, 2026 22:22
@BioCam BioCam force-pushed the mix-surface-following-distance branch from 9969597 to 5aebe16 Compare June 10, 2026 22:23
Comment on lines +83 to +84
surface_following_distance: The distance (mm) the tip follows the liquid surface each cycle on
backends that support it (e.g. Hamilton STAR); others ignore it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other backends should not just ignore things when they dont support it, they should raise errors when the value is not None

should we clarify the direction as well? probably negative for going down?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree on the raising but that would be part of each "wire into backend x PR"

I don't think the value should be negative because the direction seems to be always dictated by the atomic command:
Aspirate has to follow downwards
Dispense has to follow upwards
Because that is "following the surface" by definition
And mixing is defined as repeated aspirate-dispense cycles

Add an optional surface_following_distance (mm) to the Mix dataclass. It is an essential part of a good in-place mix on liquid handlers whose firmware drives Z in parallel with the piston (e.g. the Hamilton STAR), keeping the tip near the surface as the level changes. Backends without that capability ignore it; the default None is no surface following.

Optional with a default, so existing Mix construction and serialization are unchanged; no backend behaviour changes here.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@BioCam BioCam force-pushed the mix-surface-following-distance branch from 5aebe16 to c2a3051 Compare June 11, 2026 06:21
@BioCam BioCam merged commit 5c1e1f4 into PyLabRobot:main Jun 11, 2026
21 checks passed
@BioCam BioCam deleted the mix-surface-following-distance branch June 11, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants