Skip to content

Commit

Permalink
Uhh does this work?
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring committed Dec 19, 2023
1 parent 2bc8378 commit f42239d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion api/src/opentrons/protocol_api/core/engine/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import annotations

from typing import Optional, TYPE_CHECKING, cast, Union
from opentrons.protocols.api_support.types import APIVersion

from opentrons.types import Location, Mount
from opentrons.hardware_control import SyncHardwareAPI
Expand Down Expand Up @@ -180,6 +181,20 @@ def dispense(
in_place: whether this is a in-place command.
push_out: The amount to push the plunger below bottom position.
"""
# TODO: Is this the proper place to put this version check?
# Maybe take in a `clamp: bool` param?
# TODO: Do we also need to clamp volumes <0? Have negative dispense volumes
# worked historically?
# TODO: Reference docs
if self._protocol_core.api_version < APIVersion(2, 16):
# In older API versions, when you try to dispense more than you can,
# it gets clamped.
volume = max(volume, self.get_current_volume())
else:
# Newer API versions raise an error if you try to dispense more than
# you can. Let the error come from Protocol Engine's validation.
pass

if well_core is None:
if not in_place:
if isinstance(location, (TrashBin, WasteChute)):
Expand Down Expand Up @@ -733,7 +748,6 @@ def configure_nozzle_layout(
primary_nozzle: Optional[str],
front_right_nozzle: Optional[str],
) -> None:

if style == NozzleLayout.COLUMN:
configuration_model: NozzleLayoutConfigurationType = (
ColumnNozzleLayoutConfiguration(
Expand Down

0 comments on commit f42239d

Please sign in to comment.