Skip to content

Commit

Permalink
PR review and lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoegenburg committed Jun 18, 2024
1 parent 940e550 commit d961cf5
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,5 +181,6 @@ async def liquid_probe(
at the current location.
mount : Mount.LEFT or Mount.RIGHT
max_z_dist : maximum depth to probe for liquid
"""
...
2 changes: 1 addition & 1 deletion api/src/opentrons/protocol_engine/commands/liquid_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class LiquidProbeParams(PipetteIdMixin, WellLocationMixin):
class LiquidProbeResult(DestinationPositionResult):
"""Result data from the execution of a liquid-probe command."""

z_position: float = Field(..., description="Z position of the found liquid.")
z_position: float = Field(..., description="The Z coordinate, in mm, of the found liquid in deck space.")


_ExecuteReturn = Union[
Expand Down
3 changes: 2 additions & 1 deletion api/src/opentrons/protocol_engine/execution/pipetting.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ async def liquid_probe_in_place(
well_name: str,
) -> float:
"""Detect liquid level."""
return 0.0 # fix
# TODO (pm, 6-18-24): return a value of worth if needed
return 0.0

def _validate_tip_attached(self, pipette_id: str, command_name: str) -> None:
"""Validate if there is a tip attached."""
Expand Down
1 change: 0 additions & 1 deletion hardware-testing/hardware_testing/gravimetric/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def _get_liquid_probe_settings(
][cfg.tip_volume]
return LiquidProbeSettings(
starting_mount_height=well.top().point.z,
max_z_distance=min(well.depth, lqid_cfg["max_z_distance"]),
mount_speed=lqid_cfg["mount_speed"],
plunger_speed=lqid_cfg["plunger_speed"],
sensor_threshold_pascals=lqid_cfg["sensor_threshold_pascals"],
Expand Down
4 changes: 2 additions & 2 deletions hardware-testing/hardware_testing/gravimetric/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ def _sense_liquid_height(
lps = config._get_liquid_probe_settings(cfg, well)
# NOTE: very important that probing is done only 1x time,
# with a DRY tip, for reliability
probed_z = hwapi.liquid_probe(OT3Mount.LEFT, lps.max_z_distance, lps)
probed_z = hwapi.liquid_probe(OT3Mount.LEFT, well.depth, lps)
if ctx.is_simulating():
probed_z = well.top().point.z - 1
liq_height = probed_z - well.bottom().point.z
if abs(liq_height - lps.max_z_distance) < 0.01:
if abs(liq_height - well.depth) < 0.01:
raise RuntimeError("unable to probe liquid, reach max travel distance")
return liq_height

Expand Down
3 changes: 1 addition & 2 deletions hardware-testing/hardware_testing/liquid_sense/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ def _run_trial(
for z_dist in z_distances:
lps = LiquidProbeSettings(
starting_mount_height=start_height,
max_z_distance=z_dist,
mount_speed=run_args.z_speed,
plunger_speed=plunger_speed,
sensor_threshold_pascals=lqid_cfg["sensor_threshold_pascals"],
Expand All @@ -419,7 +418,7 @@ def _run_trial(
run_args.recorder.set_sample_tag(f"trial-{trial}-{tip}ul")
# TODO add in stuff for secondary probe
try:
height = hw_api.liquid_probe(hw_mount, lps, probe_target)
height = hw_api.liquid_probe(hw_mount, z_dist, lps, probe_target)
except PipetteLiquidNotFoundError as lnf:
ui.print_info(f"Liquid not found current position {lnf.detail}")
start_height -= z_dist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ async def _test_liquid_probe(
}
hover_mm = 3
max_submerge_mm = -3
max_z_distance_machine_coords = hover_mm - max_submerge_mm
max_z_distance_machine_coords = hover_mm - max_submerge_mm # FIXME: deck coords
assert CALIBRATED_LABWARE_LOCATIONS.plate_primary is not None
if InstrumentProbeType.SECONDARY in probes:
assert CALIBRATED_LABWARE_LOCATIONS.plate_secondary is not None
Expand All @@ -1376,7 +1376,6 @@ async def _test_liquid_probe(
probe_cfg = PROBE_SETTINGS[pip_vol][tip_volume]
probe_settings = LiquidProbeSettings(
starting_mount_height=start_pos.z,
max_z_distance=max_z_distance_machine_coords, # FIXME: deck coords
mount_speed=probe_cfg.mount_speed,
plunger_speed=probe_cfg.plunger_speed,
sensor_threshold_pascals=probe_cfg.sensor_threshold_pascals,
Expand All @@ -1385,7 +1384,7 @@ async def _test_liquid_probe(
data_files=None,
)
end_z = await api.liquid_probe(
mount, probe_settings.max_z_distance, probe_settings, probe=probe
mount, max_z_distance_machine_coords, probe_settings, probe=probe
)
if probe == InstrumentProbeType.PRIMARY:
pz = CALIBRATED_LABWARE_LOCATIONS.plate_primary.z
Expand Down

0 comments on commit d961cf5

Please sign in to comment.