From fb8a20c72208125cc3e2c9d6f324be287736d544 Mon Sep 17 00:00:00 2001 From: pmoegenburg Date: Thu, 17 Oct 2024 16:41:17 -0400 Subject: [PATCH] added geometry test --- api/src/opentrons/types.py | 2 +- .../state/test_geometry_view.py | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/api/src/opentrons/types.py b/api/src/opentrons/types.py index 37d04aa30bc..22611393f40 100644 --- a/api/src/opentrons/types.py +++ b/api/src/opentrons/types.py @@ -80,7 +80,7 @@ def magnitude_to(self, other: Any) -> float: class Location: """Location(point: Point, labware: Union["Labware", "Well", str, "ModuleGeometry", LabwareLike, None, "ModuleContext"]) - + A location to target as a motion. The location contains a :py:class:`.Point` (in diff --git a/api/tests/opentrons/protocol_engine/state/test_geometry_view.py b/api/tests/opentrons/protocol_engine/state/test_geometry_view.py index 070eeb229bb..7a94f06ca09 100644 --- a/api/tests/opentrons/protocol_engine/state/test_geometry_view.py +++ b/api/tests/opentrons/protocol_engine/state/test_geometry_view.py @@ -1808,6 +1808,31 @@ def test_get_relative_well_location( ) +def test_get_relative_liquid_handling_well_location( + decoy: Decoy, + well_plate_def: LabwareDefinition, + mock_labware_view: LabwareView, + mock_addressable_area_view: AddressableAreaView, + subject: GeometryView, +) -> None: + """It should get the relative location of a well given an absolute position.""" + result = subject.get_relative_liquid_handling_well_location( + labware_id="labware-id", + well_name="B2", + absolute_point=Point(x=0, y=0, z=-2), + is_meniscus=True, + ) + + assert result == LiquidHandlingWellLocation( + origin=WellOrigin.MENISCUS, + offset=WellOffset.construct( + x=0.0, + y=0.0, + z=cast(float, pytest.approx(-2)), + ), + ) + + def test_get_nominal_effective_tip_length( decoy: Decoy, mock_labware_view: LabwareView,