Skip to content

Commit

Permalink
docs(api): section on Position Relative to Trash Containers (#14593)
Browse files Browse the repository at this point in the history
# Overview

Follow up to further explain behavior introduced in #14560.

Addresses RTC-400.

# Test Plan

-
[sandbox](https://sandbox.docs.opentrons.com/docs-trash-offsets/v2/robot_position.html#position-relative-to-trash-containers)
- simulated snippets in 2.16 / `edge`

# Changelog

- new § on Labware and Deck Positions page
- updated description and example for `move_to()` to cover new
acceptable `location`s
- version added statements for `TrashBin`, `WasteChute`, and their
methods in API Reference

# Review requests

- double check code snippets. not only simulate, but do what i say they
do?
- confirm version added for the methods. it feels like we may need to
gate this to 2.17, because otherwise there will be a big functionality
gap between robot system 7.1 (which can't do any of this) and 7.2 (which
can). the classes are unambiguously _New in version 2.16._

# Risk assessment

low…but see API version gate caveat above.
  • Loading branch information
ecormany committed Apr 19, 2024
1 parent f206b14 commit 684a4f1
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 14 deletions.
3 changes: 0 additions & 3 deletions api/docs/v2/deck_slots.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ Starting in API version 2.16, you must load trash bin fixtures in your protocol

.. versionadded:: 2.16

.. note::
The :py:class:`.TrashBin` class doesn't have any callable methods, so you don't have to save the result of ``load_trash_bin()`` to a variable, especially if your protocol only loads a single trash container. Being able to reference the trash bin by name is useful when dealing with multiple trash containers.

Call ``load_trash_bin()`` multiple times to add more than one bin. See :ref:`pipette-trash-containers` for more information on using pipettes with multiple trash bins.

.. _configure-waste-chute:
Expand Down
27 changes: 27 additions & 0 deletions api/docs/v2/robot_position.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Top, Bottom, and Center

Every well on every piece of labware has three addressable positions: top, bottom, and center. The position is determined by the labware definition and what the labware is loaded on top of. You can use these positions as-is or calculate other positions relative to them.

.. _well-top:

Top
^^^^

Expand Down Expand Up @@ -116,6 +118,31 @@ All positions relative to labware are adjusted automatically based on labware of

You should only adjust labware offsets in your Python code if you plan to run your protocol in Jupyter Notebook or from the command line. See :ref:`using_lpc` in the Advanced Control article for information.

.. _position-relative-trash:

Position Relative to Trash Containers
=====================================

Movement to :py:class:`.TrashBin` or :py:class:`.WasteChute` objects is based on the horizontal *center* of the pipette. This is different than movement to labware, which is based on the primary channel (the back channel on 8-channel pipettes, and the back-left channel on 96-channel pipettes in default configuration). Using the center of the pipette ensures that all attached tips are over the trash container for blowing out, dropping tips, or other disposal operations.

.. note::
In API version 2.15 and earlier, trash containers are :py:class:`.Labware` objects that have a single well. See :py:obj:`.fixed_trash` and :ref:`position-relative-labware` above.

You can adjust the position of the pipette center with the :py:meth:`.TrashBin.top` and :py:meth:`.WasteChute.top` methods. These methods allow adjustments along the x-, y-, and z-axes. In contrast, ``Well.top()``, :ref:`covered above <well-top>`, only allows z-axis adjustment. With no adjustments, the "top" position is centered on the x- and y-axes and is just below the opening of the trash container.

.. code-block:: python
trash = protocol.load_trash_bin("A3")
trash # pipette center just below trash top center
trash.top() # same position
trash.top(z=10) # 10 mm higher
trash.top(y=10) # 10 mm towards back, default height
.. versionadded:: 2.18

Another difference between the trash container ``top()`` methods and ``Well.top()`` is that they return an object of the same type, not a :py:class:`.Location`. This helps prevent performing undesired actions in trash containers. For example, you can :py:meth:`.aspirate` at a location or from a well, but not from a trash container. On the other hand, you can :py:meth:`.blow_out` at a location, well, trash bin, or waste chute.

.. _protocol-api-deck-coords:

Position Relative to the Deck
Expand Down
41 changes: 30 additions & 11 deletions api/src/opentrons/protocol_api/instrument_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,27 +310,34 @@ def dispense( # noqa: C901
:type volume: int or float
:param location: Tells the robot where to dispense liquid held in the pipette.
The location can be a :py:class:`.Well` or a
:py:class:`.Location`.
The location can be a :py:class:`.Well`, :py:class:`.Location`,
:py:class:`.TrashBin`, or :py:class:`.WasteChute`.
- If the location is a ``Well``, the pipette will dispense
- If a ``Well``, the pipette will dispense
at or above the bottom center of the well. The distance (in
mm) from the well bottom is specified by
:py:obj:`well_bottom_clearance.dispense
<well_bottom_clearance>`.
- If the location is a ``Location`` (e.g., the result of
:py:meth:`.Well.top` or :py:meth:`.Well.bottom`), the robot
will dispense into that specified position.
- If a ``Location`` (e.g., the result of
:py:meth:`.Well.top` or :py:meth:`.Well.bottom`), the pipette
will dispense at that specified position.
- If the ``location`` is unspecified, the robot will
dispense into its current position.
- If a trash container, the pipette will dispense at a location
relative to its center and the trash container's top center.
See :ref:`position-relative-trash` for details.
- If unspecified, the pipette will
dispense at its current position.
If only a ``location`` is passed (e.g.,
``pipette.dispense(location=plate['A1'])``), all of the
liquid aspirated into the pipette will be dispensed (the
amount is accessible through :py:attr:`current_volume`).
.. versionchanged:: 2.16
Accepts ``TrashBin`` and ``WasteChute`` values.
:param rate: How quickly a pipette dispenses liquid. The speed in µL/s is
calculated as ``rate`` multiplied by :py:attr:`flow_rate.dispense
<flow_rate>`. If not specified, defaults to 1.0. See
Expand Down Expand Up @@ -547,7 +554,11 @@ def blow_out(
:ref:`blow-out`.
:param location: The blowout location. If no location is specified, the pipette
will blow out from its current position.
will blow out from its current position.
.. versionchanged:: 2.16
Accepts ``TrashBin`` and ``WasteChute`` values.
:type location: :py:class:`.Well` or :py:class:`.Location` or ``None``
:raises RuntimeError: If no location is specified and the location cache is
Expand Down Expand Up @@ -1032,7 +1043,11 @@ def drop_tip(
``pipette.drop_tip(location=waste_chute)``.
:param location:
The location to drop the tip.
Where to drop the tip.
.. versionchanged:: 2.16
Accepts ``TrashBin`` and ``WasteChute`` values.
:type location:
:py:class:`~.types.Location` or :py:class:`.Well` or ``None``
:param home_after:
Expand Down Expand Up @@ -1473,7 +1488,11 @@ def move_to(
See :ref:`move-to` for examples.
:param location: The location to move to.
:param location: Where to move to.
.. versionchanged:: 2.16
Accepts ``TrashBin`` and ``WasteChute`` values.
:type location: :py:class:`~.types.Location`
:param force_direct: If ``True``, move directly to the destination without arc
motion.
Expand Down

0 comments on commit 684a4f1

Please sign in to comment.