Skip to content

Commit

Permalink
fix arg logic and leq
Browse files Browse the repository at this point in the history
  • Loading branch information
sfoster1 committed Sep 5, 2023
1 parent 23b6767 commit 5e29889
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -595,22 +595,24 @@ def plan_check_dispense( # type: ignore[no-untyped-def]
if disp_vol == 0:
return None

is_full_dispense = abs(instrument.current_volume - disp_vol) < (
is_full_dispense = abs(instrument.current_volume - disp_vol) <= (
instrument.minimum_volume / 10
)
if not is_full_dispense and push_out:
raise CommandPreconditionViolated(
message="Cannot push_out on a dispense that does not leave the pipette empty",
detail={
"command": "dispense",
"remaining-volume": instrument.current_volume - disp_vol,
},
)
if push_out is None and not is_full_dispense:
push_out_ul = instrument.push_out_volume
elif push_out and not is_full_dispense:
push_out_ul = push_out

if is_full_dispense:
if push_out is None:
push_out_ul = instrument.push_out_volume
else:
push_out_ul = push_out
else:
if push_out is not None and push_out != 0:
raise CommandPreconditionViolated(
message="Cannot push_out on a dispense that does not leave the pipette empty",
detail={
"command": "dispense",
"remaining-volume": instrument.current_volume - disp_vol,
},
)
push_out_ul = 0

push_out_dist_mm = push_out_ul / instrument.ul_per_mm(push_out_ul, "blowout")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,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) < (
is_full_dispense = abs(instrument.current_volume - disp_vol) <= (
instrument.minimum_volume / 10
)

Expand Down

0 comments on commit 5e29889

Please sign in to comment.