Skip to content

Commit 05c5458

Browse files
fix(api): add more math function overrides to SimulatedLiquidProbe (#17836)
1 parent f89fd02 commit 05c5458

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

api/src/opentrons/protocol_engine/types/liquid_level_detection.py

+22
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,34 @@ def __rsub__(
4141
"""Bypass subtraction and just return self."""
4242
return self
4343

44+
def __gt__(self, other: float | SimulatedProbeResult) -> bool:
45+
"""Bypass 'greater than' and just return self."""
46+
return True
47+
48+
def __lt__(self, other: float | SimulatedProbeResult) -> bool:
49+
"""Bypass 'less than' and just return self."""
50+
return False
51+
52+
def __ge__(self, other: float | SimulatedProbeResult) -> bool:
53+
"""Bypass 'greater than or eaqual to' and just return self."""
54+
return True
55+
56+
def __le__(self, other: float | SimulatedProbeResult) -> bool:
57+
"""Bypass 'less than or equal to' and just return self."""
58+
return False
59+
4460
def __eq__(self, other: object) -> bool:
4561
"""A SimulatedProbeResult should only be equal to the same instance of its class."""
4662
if not isinstance(other, SimulatedProbeResult):
4763
return False
4864
return self is other
4965

66+
def __neq__(self, other: object) -> bool:
67+
"""A SimulatedProbeResult should only be equal to the same instance of its class."""
68+
if not isinstance(other, SimulatedProbeResult):
69+
return True
70+
return self is not other
71+
5072
def simulate_probed_aspirate_dispense(self, volume: float) -> None:
5173
"""Record the current state of aspirate/dispense calls."""
5274
self.net_liquid_exchanged_after_probe += volume

0 commit comments

Comments
 (0)