Skip to content

Commit

Permalink
api raises ValueError() if pipette tries to move plunger beyond TOP p…
Browse files Browse the repository at this point in the history
…osition
  • Loading branch information
andySigler committed Feb 4, 2025
1 parent f37ad5d commit 888182b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,11 @@ def plunger_position(
multiplier = 1.0 + (correction_volume / ul)
mm_dist_from_bottom = ul / instr.ul_per_mm(ul, action)
mm_dist_from_bottom_corrected = mm_dist_from_bottom * multiplier
max_mm = instr.plunger_positions.bottom - instr.plunger_positions.top
if mm_dist_from_bottom_corrected > max_mm:
raise ValueError(f"Pipette does not support displacement of "
f"{round(mm_dist_from_bottom_corrected, 2)} mm "
f"(maximum is {max_mm} mm)")
position = instr.plunger_positions.bottom - mm_dist_from_bottom_corrected
return round(position, 6)

Expand Down

0 comments on commit 888182b

Please sign in to comment.