Skip to content

Commit

Permalink
docs(api): new ProtocolContext.deck behavior for multi-slot modules (
Browse files Browse the repository at this point in the history
…#14523)

Follow up to dev work in #14491.
  • Loading branch information
ecormany authored Feb 21, 2024
1 parent 78c85fc commit f30f52a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
9 changes: 0 additions & 9 deletions api/docs/v2/versioning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ This table lists the correspondence between Protocol API versions and robot soft
Changes in API Versions
=======================

Version 2.17
------------

- :py:meth:`.dispense` will now raise an error if you try to dispense more than is available.

Version 2.16
------------

Expand All @@ -152,10 +147,6 @@ This version introduces new features for Flex and adds and improves methods for

- :py:obj:`.ProtocolContext.fixed_trash` and :py:obj:`.InstrumentContext.trash_container` now return :py:class:`.TrashBin` objects instead of :py:class:`.Labware` objects.
- Flex will no longer automatically drop tips in the trash at the end of a protocol. You can add a :py:meth:`.drop_tip()` command to your protocol or use the Opentrons App to drop the tips.

- Known issues

- It's possible to load a Thermocycler and then load another item in slot A1. Don't do this, as it could lead to unexpected pipetting behavior and crashes.

Version 2.15
------------
Expand Down
4 changes: 0 additions & 4 deletions api/src/opentrons/protocol_api/instrument_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,6 @@ def dispense( # noqa: C901
.. versionchanged:: 2.15
Added the ``push_out`` parameter.
.. versionchanged:: 2.17
Now raises an exception if you try to dispense more than is available.
Previously, it would silently clamp.
"""
if self.api_version < APIVersion(2, 15) and push_out:
raise APIVersionError(
Expand Down
17 changes: 14 additions & 3 deletions api/src/opentrons/protocol_api/protocol_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,9 +1066,17 @@ def deck(self) -> Deck:
For instance, ``deck[1]``, ``deck["1"]``, and ``deck["D1"]``
will all return the object loaded in the front-left slot.
The value will be a :py:obj:`~opentrons.protocol_api.Labware` if the slot contains a
labware, a module context if the slot contains a hardware
module, or ``None`` if the slot doesn't contain anything.
The value for each key depends on what is loaded in the slot:
- A :py:obj:`~opentrons.protocol_api.Labware` if the slot contains a labware.
- A module context if the slot contains a hardware module.
- ``None`` if the slot doesn't contain anything.
A module that occupies multiple slots is set as the value for all of the
relevant slots. Currently, the only multiple-slot module is the Thermocycler.
When loaded, the :py:class:`ThermocyclerContext` object is the value for
``deck`` keys ``"A1"`` and ``"B1"`` on Flex, and ``7``, ``8``, ``10``, and
``11`` on OT-2. In API version 2.13 and earlier, only slot 7 keyed to the
Thermocycler object, and slots 8, 10, and 11 keyed to ``None``.
Rather than filtering the objects in the deck map yourself,
you can also use :py:attr:`loaded_labwares` to get a dict of labwares
Expand All @@ -1085,6 +1093,9 @@ def deck(self) -> Deck:
reflect the new deck state, add a :py:meth:`.pause` or use
:py:meth:`.move_labware` instead.
.. versionchanged:: 2.14
Includes the Thermocycler in all of the slots it occupies.
.. versionchanged:: 2.15
``del`` sets the corresponding labware's location to ``OFF_DECK``.
"""
Expand Down

0 comments on commit f30f52a

Please sign in to comment.