Skip to content

Commit

Permalink
reduce PE constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoegenburg committed Oct 16, 2024
1 parent cedc8b4 commit 7fe0451
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 37 deletions.
7 changes: 1 addition & 6 deletions api/src/opentrons/protocol_engine/commands/dispense.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,7 @@ async def execute(self, params: DispenseParams) -> _ExecuteReturn:
well_name = params.wellName
volume = params.volume

self._state_view.geometry.validate_dispense_volume_into_well(
labware_id=labware_id,
well_name=well_name,
well_location=well_location,
volume=volume,
)
# TODO(pbm, 10-15-24): call self._state_view.geometry.validate_dispense_volume_into_well()

position = await self._movement.move_to_well(
pipette_id=params.pipetteId,
Expand Down
9 changes: 5 additions & 4 deletions api/src/opentrons/protocol_engine/commands/move_to_well.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import TYPE_CHECKING, Optional, Type
from typing_extensions import Literal

from ..types import DeckPoint, WellOrigin
from ..types import DeckPoint
from .pipetting_common import (
PipetteIdMixin,
WellLocationMixin,
Expand Down Expand Up @@ -56,11 +56,12 @@ async def execute(

state_update = update_types.StateUpdate()

if (self._state_view.labware.is_tiprack(labware_id)) and (
well_location.origin == WellOrigin.MENISCUS or well_location.volumeOffset
if (
self._state_view.labware.is_tiprack(labware_id)
and well_location.volumeOffset
):
raise LabwareIsTipRackError(
"Cannot specify a WellLocation with an origin of MENISCUS or any volumeOffset with movement to a tip rack"
"Cannot specify a WellLocation with a volumeOffset with movement to a tip rack"
)

x, y, z = await self._movement.move_to_well(
Expand Down
27 changes: 0 additions & 27 deletions api/tests/opentrons/protocol_engine/commands/test_move_to_well.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from opentrons.protocol_engine import (
WellLocation,
WellOrigin,
WellOffset,
DeckPoint,
errors,
Expand Down Expand Up @@ -73,32 +72,6 @@ async def test_move_to_well_implementation(
)


async def test_move_to_well_with_tip_rack_and_meniscus(
decoy: Decoy,
mock_state_view: StateView,
movement: MovementHandler,
) -> None:
"""It should disallow movement to a tip rack when MENISCUS is specified."""
subject = MoveToWellImplementation(state_view=mock_state_view, movement=movement)

data = MoveToWellParams(
pipetteId="abc",
labwareId="123",
wellName="A3",
wellLocation=WellLocation(
origin=WellOrigin.MENISCUS, offset=WellOffset(x=1, y=2, z=3)
),
forceDirect=True,
minimumZHeight=4.56,
speed=7.89,
)

decoy.when(mock_state_view.labware.is_tiprack("123")).then_return(True)

with pytest.raises(errors.LabwareIsTipRackError):
await subject.execute(data)


async def test_move_to_well_with_tip_rack_and_volume_offset(
decoy: Decoy,
mock_state_view: StateView,
Expand Down

0 comments on commit 7fe0451

Please sign in to comment.