From 3c12e94ee0d6d17ecc66127651fb6d7d6ea8816d Mon Sep 17 00:00:00 2001 From: Sanniti Pimpley Date: Tue, 16 Aug 2022 13:31:34 -0400 Subject: [PATCH] feat(papi-v2): home both pipettes at once before specific h/s actions (#11330) --- api/src/opentrons/protocol_api/module_contexts.py | 6 ++---- api/tests/opentrons/protocol_api/test_module_context.py | 9 ++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/api/src/opentrons/protocol_api/module_contexts.py b/api/src/opentrons/protocol_api/module_contexts.py index 0f998298459..232862b098c 100644 --- a/api/src/opentrons/protocol_api/module_contexts.py +++ b/api/src/opentrons/protocol_api/module_contexts.py @@ -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: @@ -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 diff --git a/api/tests/opentrons/protocol_api/test_module_context.py b/api/tests/opentrons/protocol_api/test_module_context.py index f47af08716f..66dbcc501a6 100644 --- a/api/tests/opentrons/protocol_api/test_module_context.py +++ b/api/tests/opentrons/protocol_api/test_module_context.py @@ -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, @@ -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 @@ -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