Skip to content

Commit

Permalink
feat(papi-v2): home both pipettes at once before specific h/s actions (
Browse files Browse the repository at this point in the history
  • Loading branch information
sanni-t authored Aug 16, 2022
1 parent d28bc76 commit 3c12e94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 2 additions & 4 deletions api/src/opentrons/protocol_api/module_contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,8 +1038,7 @@ def _prepare_for_shake(self) -> None:
):
ctx_implementation = self._ctx._implementation
hardware = ctx_implementation.get_hardware()
for mount in types.Mount:
hardware.retract(mount=mount)
hardware.home(axes=[axis for axis in Axis.mount_axes()])
self._ctx.location_cache = None

def _prepare_for_latch_open(self) -> None:
Expand All @@ -1052,6 +1051,5 @@ def _prepare_for_latch_open(self) -> None:
):
ctx_implementation = self._ctx._implementation
hardware = ctx_implementation.get_hardware()
for mount in types.Mount:
hardware.retract(mount=mount)
hardware.home(axes=[axis for axis in Axis.mount_axes()])
self._ctx.location_cache = None
9 changes: 4 additions & 5 deletions api/tests/opentrons/protocol_api/test_module_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import opentrons.protocol_api as papi
import opentrons.protocols.geometry as papi_geometry

from opentrons.types import Point, Location, Mount
from opentrons.types import Point, Location
from opentrons.drivers.types import HeaterShakerLabwareLatchStatus
from opentrons.hardware_control.types import Axis
from opentrons.hardware_control.modules.magdeck import OFFSET_TO_LABWARE_BOTTOM
from opentrons.hardware_control.modules.types import (
ModuleModel,
Expand Down Expand Up @@ -752,8 +753,7 @@ def test_heater_shaker_set_and_wait_for_shake_speed(
hs_mod.geometry.is_pipette_blocking_shake_movement.assert_called_with( # type: ignore[attr-defined]
pipette_location=mock_pipette_location
)
calls = [mock.call(mount=Mount.LEFT), mock.call(mount=Mount.RIGHT)]
mock_hardware.retract.assert_has_calls(calls, any_order=True)
mock_hardware.home.assert_called_once_with(axes=[Axis.Z, Axis.A])
mock_module_controller.set_speed.assert_called_once_with(rpm=10)
assert ctx_with_heater_shaker.location_cache is None

Expand Down Expand Up @@ -806,8 +806,7 @@ def test_heater_shaker_open_labware_latch(
hs_mod.geometry.is_pipette_blocking_latch_movement.assert_called_with( # type: ignore[attr-defined]
pipette_location=mock_pipette_location
)
calls = [mock.call(mount=Mount.LEFT), mock.call(mount=Mount.RIGHT)]
mock_hardware.retract.assert_has_calls(calls, any_order=True)
mock_hardware.home.assert_called_once_with(axes=[Axis.Z, Axis.A])
mock_module_controller.open_labware_latch.assert_called_once()
assert ctx_with_heater_shaker.location_cache is None

Expand Down

0 comments on commit 3c12e94

Please sign in to comment.