diff --git a/api/src/opentrons/protocol_engine/state/geometry.py b/api/src/opentrons/protocol_engine/state/geometry.py index 06125a82cdc..a0fef65e7ee 100644 --- a/api/src/opentrons/protocol_engine/state/geometry.py +++ b/api/src/opentrons/protocol_engine/state/geometry.py @@ -434,11 +434,11 @@ def get_well_position( elif well_location.origin == WellOrigin.CENTER: offset = offset.copy(update={"z": offset.z + well_depth / 2.0}) elif well_location.origin == WellOrigin.MENISCUS: - height = self._wells.get_last_measured_liquid_height( + liquid_height = self._wells.get_last_measured_liquid_height( labware_id, well_name - ) # in deck coordinates - if height is not None: - offset = offset.copy(update={"z": offset.z + height}) + ) + if liquid_height is not None: + offset = offset.copy(update={"z": offset.z + liquid_height}) else: raise errors.LiquidHeightUnknownError( "Must liquid probe before specifying WellOrigin.MENISCUS." diff --git a/api/src/opentrons/protocols/api_support/definitions.py b/api/src/opentrons/protocols/api_support/definitions.py index 799af1993f3..ad692e03828 100644 --- a/api/src/opentrons/protocols/api_support/definitions.py +++ b/api/src/opentrons/protocols/api_support/definitions.py @@ -1,6 +1,6 @@ from .types import APIVersion -MAX_SUPPORTED_VERSION = APIVersion(2, 20) +MAX_SUPPORTED_VERSION = APIVersion(2, 21) """The maximum supported protocol API version in this release.""" MIN_SUPPORTED_VERSION = APIVersion(2, 0) diff --git a/api/tests/opentrons/protocol_api/test_well.py b/api/tests/opentrons/protocol_api/test_well.py index 00cbbac8fa7..3a2ba81b9fa 100644 --- a/api/tests/opentrons/protocol_api/test_well.py +++ b/api/tests/opentrons/protocol_api/test_well.py @@ -101,6 +101,17 @@ def test_well_center(decoy: Decoy, mock_well_core: WellCore, subject: Well) -> N assert result.labware.as_well() is subject +def test_well_meniscus(decoy: Decoy, mock_well_core: WellCore, subject: Well) -> None: + """It should get a Location representing the meniscus of the well.""" + decoy.when(mock_well_core.get_meniscus(z_offset=4.2)).then_return(Point(1, 2, 3)) + + result = subject.meniscus(4.2) + + assert isinstance(result, Location) + assert result.point == Point(1, 2, 3) + assert result.labware.as_well() is subject + + def test_has_tip(decoy: Decoy, mock_well_core: WellCore, subject: Well) -> None: """It should get tip state from the core.""" decoy.when(mock_well_core.has_tip()).then_return(True)