From 2a8c6167db4d6cf83fb0ad15836d656c35f4a0d1 Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Wed, 6 Sep 2023 11:48:18 -0400 Subject: [PATCH] use numpy isclose instead of min vol / 10 --- .../hardware_control/instruments/ot2/pipette_handler.py | 5 ++--- .../hardware_control/instruments/ot3/pipette_handler.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/api/src/opentrons/hardware_control/instruments/ot2/pipette_handler.py b/api/src/opentrons/hardware_control/instruments/ot2/pipette_handler.py index 1983475914f..a8a08d49c52 100644 --- a/api/src/opentrons/hardware_control/instruments/ot2/pipette_handler.py +++ b/api/src/opentrons/hardware_control/instruments/ot2/pipette_handler.py @@ -15,6 +15,7 @@ TypeVar, overload, ) +import numpy from opentrons_shared_data.pipette.dev_types import UlPerMmAction from opentrons_shared_data.pipette.types import Quirks @@ -595,9 +596,7 @@ def plan_check_dispense( # type: ignore[no-untyped-def] if disp_vol == 0: return None - is_full_dispense = abs(instrument.current_volume - disp_vol) <= ( - instrument.minimum_volume / 10 - ) + is_full_dispense = numpy.isclose(instrument.current_volume - disp_vol, 0) if is_full_dispense: if push_out is None: diff --git a/api/src/opentrons/hardware_control/instruments/ot3/pipette_handler.py b/api/src/opentrons/hardware_control/instruments/ot3/pipette_handler.py index cf156714a1d..bee5c0dbf40 100644 --- a/api/src/opentrons/hardware_control/instruments/ot3/pipette_handler.py +++ b/api/src/opentrons/hardware_control/instruments/ot3/pipette_handler.py @@ -14,6 +14,7 @@ TypeVar, ) from typing_extensions import Final +import numpy from opentrons_shared_data.pipette.dev_types import UlPerMmAction from opentrons_shared_data.errors.exceptions import CommandPreconditionViolated @@ -577,9 +578,7 @@ def plan_check_dispense( # Ensure we don't dispense more than the current volume disp_vol = min(instrument.current_volume, disp_vol) - is_full_dispense = abs(instrument.current_volume - disp_vol) <= ( - instrument.minimum_volume / 10 - ) + is_full_dispense = numpy.isclose(instrument.current_volume - disp_vol, 0) if disp_vol == 0: return None