Skip to content

Conversation

@BioCam
Copy link
Collaborator

@BioCam BioCam commented Jan 28, 2026

Problem

Currently STARBackend.probe_liquid_heights() will error out if no liquid is detected instead of correctly detecting the absence of liquid (i.e. liquid_height=0.0 mm).
Consequently, STARBackend.probe_liquid_volumes() is also broken, and dispensing with cLLD into volume-non-deterministic destination containers is a hazard that can break aPs.

Solution / This PR

STARBackend.probe_liquid_heights() already calculates the lowest immersion position to be the well cavity bottom for safety. If a container is empty this PR introduces the catching of the specific firmware error and converts it into liquid_height=0.0mm.
At the same time, a warning is logged for these containers since it is possible to have edge cases (e.g. if cLLD: low-volume liquids don't have enough dissipation volume to be detected; ultra-pure liquids are non-conductive)

@BioCam BioCam requested a review from Copilot January 28, 2026 14:33
@BioCam BioCam requested a review from rickwierenga January 28, 2026 14:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the .probe_liquid_height() method to gracefully handle the absence of liquid in containers, rather than raising unhandled firmware errors. When liquid is not detected, the method now returns a height of 0.0 (relative to the well bottom) and logs a warning with helpful diagnostic information.

Changes:

  • Modified asyncio.gather() calls to capture and handle exceptions using return_exceptions=True
  • Added error handling logic to distinguish "no liquid found" firmware errors from other exceptions
  • Implemented consistency checking across replicates to detect edge cases where liquid detection is intermittent
  • Updated height calculation to use cavity bottom as absolute height when no liquid is detected (resulting in 0.0 relative height)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant