Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pylabrobot/resources/volume_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def remove_liquid(self, volume: float) -> List[Tuple[Optional["Liquid"], float]]
"""Remove liquid from the container. Top to bottom."""

available_volume = self.get_used_volume()
if volume > available_volume and abs(volume - available_volume) > 1e-6:
if abs(volume - available_volume) > 1e-6:
raise TooLittleLiquidError(
f"Container {self.thing} has too little liquid: {volume}uL > {available_volume}uL."
)
Expand All @@ -150,7 +150,7 @@ def remove_liquid(self, volume: float) -> List[Tuple[Optional["Liquid"], float]]
def add_liquid(self, liquid: Optional["Liquid"], volume: float) -> None:
"""Add liquid to the container."""

if volume > self.get_free_volume():
if abs(volume - self.get_free_volume()) > 1e-6:
raise TooLittleVolumeError(
f"Container {self.thing} has too little volume: {volume}uL > {self.get_free_volume()}uL."
)
Expand Down Expand Up @@ -188,7 +188,7 @@ def get_free_volume(self) -> float:
def get_liquids(self, top_volume: float) -> List[Tuple[Optional[Liquid], float]]:
"""Get the liquids in the top `top_volume` uL"""

if top_volume > self.get_used_volume():
if abs(top_volume - self.get_used_volume()) > 1e-6:
raise TooLittleLiquidError(f"Tracker only has {self.get_used_volume()}uL")

liquids = []
Expand Down
Loading