From eebc019d1ee0a68458680b94b69d69da4c4c7ef6 Mon Sep 17 00:00:00 2001 From: Laura Cox Date: Sun, 3 Nov 2024 21:01:21 +0200 Subject: [PATCH] fix linter errors --- api/src/opentrons/protocol_api/core/engine/robot.py | 2 +- api/src/opentrons/protocol_api/validation.py | 4 ++-- .../opentrons/protocol_engine/execution/gantry_mover.py | 8 ++++++-- api/tests/opentrons/protocol_api/test_robot_context.py | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/api/src/opentrons/protocol_api/core/engine/robot.py b/api/src/opentrons/protocol_api/core/engine/robot.py index 7deabff0571e..477f1968c5a3 100644 --- a/api/src/opentrons/protocol_api/core/engine/robot.py +++ b/api/src/opentrons/protocol_api/core/engine/robot.py @@ -17,7 +17,7 @@ AxisType.Z_R: MotorAxis.RIGHT_Z, AxisType.Z_G: MotorAxis.EXTENSION_Z, AxisType.G: MotorAxis.EXTENSION_JAW, - AxisType.Q: MotorAxis.CLAMP_JAW_96_CHANNEL, + AxisType.Q: MotorAxis.AXIS_96_CHANNEL_CAM, } diff --git a/api/src/opentrons/protocol_api/validation.py b/api/src/opentrons/protocol_api/validation.py index 6b491d7e9b44..1f8fb4bd8c80 100644 --- a/api/src/opentrons/protocol_api/validation.py +++ b/api/src/opentrons/protocol_api/validation.py @@ -260,9 +260,9 @@ def ensure_only_gantry_axis_map_type( f"A critical point only accepts OT-2 gantry axes which are {AxisType.ot2_gantry_axes()}" ) else: - if any(k not in AxisType.ot3_gantry_axes() for k in axis_map.keys()): + if any(k not in AxisType.flex_gantry_axes() for k in axis_map.keys()): raise IncorrectAxisError( - f"A critical point only accepts Flex gantry axes which are {AxisType.ot3_gantry_axes()}" + f"A critical point only accepts Flex gantry axes which are {AxisType.flex_gantry_axes()}" ) diff --git a/api/src/opentrons/protocol_engine/execution/gantry_mover.py b/api/src/opentrons/protocol_engine/execution/gantry_mover.py index 05680ca46b97..7306bc4e4d1c 100644 --- a/api/src/opentrons/protocol_engine/execution/gantry_mover.py +++ b/api/src/opentrons/protocol_engine/execution/gantry_mover.py @@ -74,6 +74,8 @@ # That OT3Simulator return value is what Protocol Engine uses for simulation when Protocol Engine # is configured to not virtualize pipettes, so this number should match it. VIRTUAL_MAX_OT3_HEIGHT = 248.0 +# This number was found by using the longest pipette's P1000V2 default configuration values. +VIRTUAL_MAX_OT2_HEIGHT = 268.14 class GantryMover(TypingProtocol): @@ -544,8 +546,10 @@ def get_max_travel_z_from_mount(self, mount: MountType) -> float: """Get the maximum allowed z-height for mount.""" pipette = self._state_view.pipettes.get_by_mount(mount) if self._state_view.config.robot_type == "OT-2 Standard": - instrument_height = self._state_view.pipettes.get_instrument_max_height_ot2( - pipette.id + instrument_height = ( + self._state_view.pipettes.get_instrument_max_height_ot2(pipette.id) + if pipette + else VIRTUAL_MAX_OT2_HEIGHT ) else: instrument_height = VIRTUAL_MAX_OT3_HEIGHT diff --git a/api/tests/opentrons/protocol_api/test_robot_context.py b/api/tests/opentrons/protocol_api/test_robot_context.py index 3e0be14b865d..c1bdfe48c3f7 100644 --- a/api/tests/opentrons/protocol_api/test_robot_context.py +++ b/api/tests/opentrons/protocol_api/test_robot_context.py @@ -15,7 +15,7 @@ ) from opentrons.protocols.api_support.types import APIVersion from opentrons.protocol_api.core.common import ProtocolCore, RobotCore -from opentrons.protocol_api import RobotContext, ModuleContext, MAX_SUPPORTED_VERSION +from opentrons.protocol_api import RobotContext, ModuleContext from opentrons.protocol_api.deck import Deck @@ -28,7 +28,7 @@ def mock_core(decoy: Decoy) -> RobotCore: @pytest.fixture def api_version() -> APIVersion: """Get the API version to test at.""" - return MAX_SUPPORTED_VERSION + return APIVersion(2, 22) @pytest.fixture