Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): Addition of distribution error to prevent invalid disposal values #13659

9 changes: 9 additions & 0 deletions api/src/opentrons/protocols/advanced_control/transfers.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,12 @@ def _extend_source_target_lists(
]
return sources, targets

def _check_valid_disposal_volume(self):
if self._strategy.disposal_volume >= self._instr.max_volume:
SyntaxColoring marked this conversation as resolved.
Show resolved Hide resolved
raise ValueError(
"The disposal volume must be less than the maximum volume of the pipette"
)

def _plan_distribute(self):
"""
* **Source/ Dest:** One source to many destinations
Expand Down Expand Up @@ -571,6 +577,9 @@ def _plan_distribute(self):
.. Dispense air gap -> ...*

"""

self._check_valid_disposal_volume()
SyntaxColoring marked this conversation as resolved.
Show resolved Hide resolved

# TODO: decide whether default disposal vol for distribute should be
# pipette min_vol or should we leave it to being 0 by default and
# recommend users to specify a disposal vol when using distribute.
Expand Down
Loading