Skip to content

Commit

Permalink
eliminated max_z_distance from LiquidProbeSettings struct
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoegenburg committed Jun 18, 2024
1 parent 810943a commit 940e550
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 12 deletions.
2 changes: 0 additions & 2 deletions api/src/opentrons/config/defaults_ot3.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

DEFAULT_LIQUID_PROBE_SETTINGS: Final[LiquidProbeSettings] = LiquidProbeSettings(
starting_mount_height=100,
max_z_distance=40,
mount_speed=10,
plunger_speed=5,
sensor_threshold_pascals=40,
Expand Down Expand Up @@ -335,7 +334,6 @@ def _build_default_liquid_probe(
starting_mount_height=from_conf.get(
"starting_mount_height", default.starting_mount_height
),
max_z_distance=from_conf.get("max_z_distance", default.max_z_distance),
mount_speed=from_conf.get("mount_speed", default.mount_speed),
plunger_speed=from_conf.get("plunger_speed", default.plunger_speed),
sensor_threshold_pascals=from_conf.get(
Expand Down
1 change: 0 additions & 1 deletion api/src/opentrons/config/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ class ZSenseSettings:
@dataclass
class LiquidProbeSettings:
starting_mount_height: float
max_z_distance: float
mount_speed: float
plunger_speed: float
sensor_threshold_pascals: float
Expand Down
1 change: 0 additions & 1 deletion api/tests/opentrons/config/ot3_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
"gripper_mount_offset": (1, 1, 1),
"liquid_sense": {
"starting_mount_height": 80,
"max_z_distance": 20,
"mount_speed": 10,
"plunger_speed": 10,
"sensor_threshold_pascals": 17,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def controller(
def fake_liquid_settings() -> LiquidProbeSettings:
return LiquidProbeSettings(
starting_mount_height=100,
max_z_distance=15,
mount_speed=40,
plunger_speed=10,
sensor_threshold_pascals=15,
Expand Down Expand Up @@ -712,10 +711,11 @@ async def test_liquid_probe(
mock_move_group_run: mock.AsyncMock,
mock_send_stop_threshold: mock.AsyncMock,
) -> None:
fake_max_z_dist = 15.0
try:
await controller.liquid_probe(
mount=mount,
max_z_distance=fake_liquid_settings.max_z_distance,
max_z_distance=fake_max_z_dist,
mount_speed=fake_liquid_settings.mount_speed,
plunger_speed=fake_liquid_settings.plunger_speed,
threshold_pascals=fake_liquid_settings.sensor_threshold_pascals,
Expand Down
4 changes: 0 additions & 4 deletions api/tests/opentrons/hardware_control/test_ot3_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ def fake_settings() -> CapacitivePassSettings:
def fake_liquid_settings() -> LiquidProbeSettings:
return LiquidProbeSettings(
starting_mount_height=100,
max_z_distance=15,
mount_speed=40,
plunger_speed=10,
sensor_threshold_pascals=15,
Expand Down Expand Up @@ -825,7 +824,6 @@ async def test_liquid_probe(
mock_liquid_probe.return_value = return_dict
fake_settings_aspirate = LiquidProbeSettings(
starting_mount_height=100,
max_z_distance=15,
mount_speed=40,
plunger_speed=10,
sensor_threshold_pascals=15,
Expand Down Expand Up @@ -894,7 +892,6 @@ async def test_multi_liquid_probe(
mock_liquid_probe.side_effect = side_effects
fake_settings_aspirate = LiquidProbeSettings(
starting_mount_height=100,
max_z_distance=3,
mount_speed=1,
plunger_speed=71.5,
sensor_threshold_pascals=15,
Expand Down Expand Up @@ -963,7 +960,6 @@ async def test_liquid_not_found(
mock_liquid_probe.side_effect = side_effects
fake_settings_aspirate = LiquidProbeSettings(
starting_mount_height=100,
max_z_distance=3,
mount_speed=1,
plunger_speed=71.5,
sensor_threshold_pascals=15,
Expand Down
4 changes: 2 additions & 2 deletions hardware/opentrons_hardware/hardware_control/sensor_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from opentrons_shared_data.errors.exceptions import (
TipHitWellBottomError,
LiquidNotFoundError,
PipetteLiquidNotFoundError,
)


Expand All @@ -14,7 +14,7 @@ def did_tip_hit_liquid(
) -> bool:
"""Detects if tip has hit liquid or solid based on given pressure data."""
if len(pressure_readings) < 5:
raise LiquidNotFoundError(
raise PipetteLiquidNotFoundError(
"Liquid not found. Not enough data to calculate pressure change",
)
pressure_difference = np.gradient(pressure_readings[-5:], 1)
Expand Down

0 comments on commit 940e550

Please sign in to comment.