Skip to content

Commit

Permalink
use numpy isclose instead of min vol / 10
Browse files Browse the repository at this point in the history
  • Loading branch information
sfoster1 committed Sep 6, 2023
1 parent 5e29889 commit 2a8c616
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2a8c616

Please sign in to comment.