Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(engine): allow dropping tips in any labware #13504

Merged
merged 2 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions api/src/opentrons/protocol_api/instrument_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,8 +862,9 @@ def drop_tip(

If no location is passed, the Pipette will drop the tip into its
:py:attr:`trash_container`, which if not specified defaults to
the fixed trash in slot 12. From API version 2.15 on, the API will default to
alternating between two different drop tip locations within the trash container
the fixed trash in slot 12. From API version 2.15 on, if the trash container is
the default fixed trash in A3 (slot 12), the API will default to
dropping tips in different points within the trash container
in order to prevent tips from piling up in a single location in the trash.

The location in which to drop the tip can be manually specified with
Expand Down
10 changes: 6 additions & 4 deletions api/src/opentrons/protocol_engine/state/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,15 @@ def get_checked_tip_drop_location(
offset=well_location.offset,
)

# return to top if labware is fixed trash
if self._labware.get_has_quirk(labware_id=labware_id, quirk="fixedTrash"):
z_offset = well_location.offset.z
else:
if self._labware.get_definition(labware_id).parameters.isTiprack:
z_offset = self._labware.get_tip_drop_z_offset(
labware_id=labware_id,
length_scale=self._pipettes.get_return_tip_scale(pipette_id),
additional_offset=well_location.offset.z,
)
else:
# return to top if labware is not tip rack
z_offset = well_location.offset.z

return WellLocation(
origin=WellOrigin.TOP,
Expand Down Expand Up @@ -552,6 +552,8 @@ def get_next_tip_drop_location(
# In order to avoid the complexity of finding tip drop locations for
# variety of labware with different well configs, we will allow
# location cycling only for fixed trash labware right now.
# TODO (spp, 2023-09-12): update this to possibly a labware-width based check,
# or a 'trash' quirk check, once movable trash is implemented.
return DropTipWellLocation(
origin=DropTipWellOrigin.DEFAULT,
offset=WellOffset(x=0, y=0, z=0),
Expand Down
12 changes: 7 additions & 5 deletions api/tests/opentrons/protocol_engine/state/test_geometry_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,8 +944,11 @@ def test_get_tip_drop_location(
labware_view: LabwareView,
mock_pipette_view: PipetteView,
subject: GeometryView,
tip_rack_def: LabwareDefinition,
) -> None:
"""It should get relative drop tip location for a pipette/labware combo."""
decoy.when(labware_view.get_definition("tip-rack-id")).then_return(tip_rack_def)

decoy.when(mock_pipette_view.get_return_tip_scale("pipette-id")).then_return(0.5)

decoy.when(
Expand All @@ -966,15 +969,14 @@ def test_get_tip_drop_location(
assert location == WellLocation(offset=WellOffset(x=1, y=2, z=1337))


def test_get_tip_drop_location_with_trash(
def test_get_tip_drop_location_with_non_tiprack(
decoy: Decoy,
labware_view: LabwareView,
subject: GeometryView,
reservoir_def: LabwareDefinition,
) -> None:
"""It should get relative drop tip location for a the fixed trash."""
decoy.when(
labware_view.get_has_quirk(labware_id="labware-id", quirk="fixedTrash")
).then_return(True)
"""It should get relative drop tip location for a labware that is not a tiprack."""
decoy.when(labware_view.get_definition("labware-id")).then_return(reservoir_def)

location = subject.get_checked_tip_drop_location(
pipette_id="pipette-id",
Expand Down