diff --git a/api/src/opentrons/protocol_api/core/engine/deck_conflict.py b/api/src/opentrons/protocol_api/core/engine/deck_conflict.py index dc290fe01ae..f242fc87836 100644 --- a/api/src/opentrons/protocol_api/core/engine/deck_conflict.py +++ b/api/src/opentrons/protocol_api/core/engine/deck_conflict.py @@ -79,9 +79,6 @@ def __init__(self, message: str) -> None: x=A12_column_back_right_bound.x - _NOZZLE_PITCH * 11, y=506.2 ) -# Arbitrary safety margin in z-direction -Z_SAFETY_MARGIN = 10 - _FLEX_TC_LID_BACK_LEFT_PT = Point( x=FLEX_TC_LID_COLLISION_ZONE["back_left"]["x"], y=FLEX_TC_LID_COLLISION_ZONE["back_left"]["y"], @@ -333,7 +330,7 @@ def _slot_has_potential_colliding_object( slot_highest_z = engine_state.geometry.get_highest_z_in_slot( StagingSlotLocation(slotName=surrounding_slot) ) - return slot_highest_z + Z_SAFETY_MARGIN > pipette_bounds[0].z + return slot_highest_z >= pipette_bounds[0].z return False diff --git a/api/src/opentrons/protocol_api/instrument_context.py b/api/src/opentrons/protocol_api/instrument_context.py index 45b7d385684..03b843e4ffa 100644 --- a/api/src/opentrons/protocol_api/instrument_context.py +++ b/api/src/opentrons/protocol_api/instrument_context.py @@ -1103,6 +1103,7 @@ def home_plunger(self) -> InstrumentContext: self._core.home_plunger() return self + # TODO (spp, 2024-03-08): verify if ok to & change source & dest types to AdvancedLiquidHandling @publisher.publish(command=cmds.distribute) @requires_version(2, 0) def distribute( @@ -1142,6 +1143,7 @@ def distribute( return self.transfer(volume, source, dest, **kwargs) + # TODO (spp, 2024-03-08): verify if ok to & change source & dest types to AdvancedLiquidHandling @publisher.publish(command=cmds.consolidate) @requires_version(2, 0) def consolidate( diff --git a/api/tests/opentrons/protocol_api_integration/test_pipette_movement_deck_conflicts.py b/api/tests/opentrons/protocol_api_integration/test_pipette_movement_deck_conflicts.py index 2ad7b63615a..33e92086edb 100644 --- a/api/tests/opentrons/protocol_api_integration/test_pipette_movement_deck_conflicts.py +++ b/api/tests/opentrons/protocol_api_integration/test_pipette_movement_deck_conflicts.py @@ -99,6 +99,36 @@ def test_deck_conflicts_for_96_ch_a12_column_configuration() -> None: instrument.dispense(50, accessible_plate.wells_by_name()["A1"]) +@pytest.mark.ot3_only +def test_close_shave_deck_conflicts_for_96_ch_a12_column_configuration() -> None: + """Shouldn't raise errors for "almost collision"s.""" + protocol_context = simulate.get_protocol_api(version="2.16", robot_type="Flex") + res12 = protocol_context.load_labware("nest_12_reservoir_15ml", "C3") + + # Mag block and tiprack adapter are very close to the destination reservoir labware + protocol_context.load_module("magneticBlockV1", "D2") + protocol_context.load_labware( + "opentrons_flex_96_tiprack_200ul", + "B3", + adapter="opentrons_flex_96_tiprack_adapter", + ) + tiprack_8 = protocol_context.load_labware("opentrons_flex_96_tiprack_200ul", "B2") + hs = protocol_context.load_module("heaterShakerModuleV1", "D1") + hs_adapter = hs.load_adapter("opentrons_96_deep_well_adapter") + deepwell = hs_adapter.load_labware("nest_96_wellplate_2ml_deep") + protocol_context.load_trash_bin("A3") + p1000_96 = protocol_context.load_instrument("flex_96channel_1000") + p1000_96.configure_nozzle_layout(style=COLUMN, start="A12", tip_racks=[tiprack_8]) + + hs.close_labware_latch() # type: ignore[union-attr] + p1000_96.distribute( + 15, + res12.wells()[0], + deepwell.rows()[0], + disposal_vol=0, + ) + + @pytest.mark.ot3_only def test_deck_conflicts_for_96_ch_a1_column_configuration() -> None: """It should raise errors for expected deck conflicts."""