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(api): Raise cases for unsupported nozzle layouts #15009

Merged
merged 4 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions api/docs/v2/pipettes/partial_tip_pickup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ For greater convenience, also import the individual layout constants that you pl

Then when you call ``configure_nozzle_layout`` later in your protocol, you can set ``style=COLUMN``.

It is important to note that for versions <= 7.3, when configuring for COLUMN layout, there may be a noticeable tip overlap offset that will need to be accounted for through Labware Position Check.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there isn't an API change here, I think this is best addressed in the 7.3 release notes, probably under the "Improved features" header.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another possible location is as a note in the API Reference entry. Regardless, I think I'd want to keep it out of the main description of the feature in this article — especially if we've improved the behavior to the point that we don't have to be issuing warnings about how the latest version works.


Along that same line of logic, it would be advisable to determine a configuration to be used for a specific labware, and only interact with that labware when in said configuration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what this means.


Here is the start of a protocol that performs both imports, loads a 96-channel pipette, and sets it to pick up a single column of tips.

.. code-block:: python
Expand Down
13 changes: 13 additions & 0 deletions api/src/opentrons/hardware_control/nozzle_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
)
from opentrons_shared_data.errors import ErrorCodes, GeneralError, PythonException

MAXIMUM_NOZZLE_COUNT = 24


def _nozzle_names_by_row(rows: List[PipetteRowDefinition]) -> Iterator[str]:
for row in rows:
Expand Down Expand Up @@ -267,6 +269,17 @@ def build(
(nozzle, physical_nozzles[nozzle]) for nozzle in chain(*rows.values())
)

if (
NozzleConfigurationType.determine_nozzle_configuration(
physical_rows, rows, physical_columns, columns
)
!= NozzleConfigurationType.FULL
):
if len(rows) * len(columns) > MAXIMUM_NOZZLE_COUNT:
raise IncompatibleNozzleConfiguration(
f"Partial Nozzle Layouts may not be configured to contain more than {MAXIMUM_NOZZLE_COUNT} channels."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy suggestion

Suggested change
f"Partial Nozzle Layouts may not be configured to contain more than {MAXIMUM_NOZZLE_COUNT} channels."
f"Partial nozzle layouts can contain at most {MAXIMUM_NOZZLE_COUNT} channels."

)

return cls(
starting_nozzle=starting_nozzle,
map_store=map_store,
Expand Down
26 changes: 20 additions & 6 deletions api/src/opentrons/protocol_api/instrument_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -1928,12 +1928,12 @@ def configure_nozzle_layout(
should be of the same format used when identifying wells by name.
Required unless setting ``style=ALL``.

.. note::
When using the ``COLUMN`` layout, the only fully supported value is
``start="A12"``. You can use ``start="A1"``, but this will disable tip
tracking and you will have to specify the ``location`` every time you
call :py:meth:`.pick_up_tip`, such that the pipette picks up columns of
tips *from right to left* on the tip rack.
.. note:
When configuring for the ``COLUMN`` layout in versions <= 7.3 it is
recommended to perform Labware Position Check on the labware that will be
interacted with in a partial configuration. Failure to do so may result
in a tip overlap of up to 0.5mm and the raising of Overpressure errors
in certain edge cases.

:type start: str or ``None``
:param tip_racks: Behaves the same as setting the ``tip_racks`` parameter of
Expand All @@ -1947,6 +1947,20 @@ def configure_nozzle_layout(
# :param front_right: The nozzle at the front left of the layout. Only used for
# NozzleLayout.QUADRANT configurations.
# :type front_right: str or ``None``
#
# NOTE: Disabled layouts error case can be removed once desired map configurations
# have appropriate data regarding tip-type to map current values added to the
# pipette definitions.
disabled_layouts = [
NozzleLayout.ROW,
NozzleLayout.SINGLE,
NozzleLayout.QUADRANT,
]
if style in disabled_layouts:
raise ValueError(
f"Nozzle layout configuration of style {style.value} is currently unsupported."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy suggestion

Suggested change
f"Nozzle layout configuration of style {style.value} is currently unsupported."
f"{style.value} nozzle layouts are currently not supported."

)

if style != NozzleLayout.ALL:
if start is None:
raise ValueError(
Expand Down
Loading