Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): change liquid_probe to respect min well height #15488

Merged
merged 12 commits into from
Jun 26, 2024
Prev Previous commit
Next Next commit
Remove old well min height calculation
  • Loading branch information
aaron-kulkarni committed Jun 24, 2024
commit fff6196efe727ef9c7bac7ad2d0385a7f4c6ad18
31 changes: 0 additions & 31 deletions api/src/opentrons/protocol_engine/state/labware.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,37 +413,6 @@ def get_should_center_pipette_on_target_well(self, labware_id: str) -> bool:
or len(self.get_definition(labware_id).wells) >= 96
)

def get_well_min_height(self, labware_id: str, well_name: str) -> float:
"""Get's the minimum distance that a liquid probe must stop away from the bottom of a well.

Args:
labware_id: Labware identifier.
well_name: Name of well in labware.

Returns:
A single float representing the distance, in millimeters.
"""
labware_definition = self.get_definition(labware_id)
default_val = 0.0
if (
labware_definition.liquidProbeParameters is None
or labware_definition.liquidProbeParameters.minimumHeight is None
):
return default_val
height_reqs = labware_definition.liquidProbeParameters.minimumHeight
if len(height_reqs) == 0:
return default_val
if len(height_reqs) == 1:
return float(height_reqs[0]["value"])
for entry in height_reqs:
if well_name in entry["applicableWells"]:
return float(entry["value"])
if (
entry["applicableWells"] == []
): # A "custom" default value will have "applicableWells" set to []
default_val = float(entry["value"])
return default_val

def get_well_definition(
self,
labware_id: str,
Expand Down