Skip to content

docs(api): load liquids in API 2.23 #18025

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

Open
wants to merge 5 commits into
base: chore_release-8.4.0
Choose a base branch
from

Conversation

emilyburghardt
Copy link
Collaborator

Overview

documenting a new method for loading liquids into labware in API 2.23.

Test Plan and Hands on Testing

sandbox: http://sandbox.docs.opentrons.com/docs-load-liquid/v2/

Changelog

  • updated "labeling liquids in wells" to "labeling liquids in labware"; changed examples in this section to use our new methods: Labware.load_liquid and Labware.load_liquid_by_well, and a mention for Labware.load_empty.
  • updated the API reference entries for the methods above, + added a deprecated message for the original load_liquid.

Review requests

  • code blocks correct? especially wells in each example...
  • anything I'm missing?
  • I edited the original API reference entries to remove the examples (used to write the examples in Labeling Liquids in Labware). Do we want them back?

Risk assessment

@emilyburghardt emilyburghardt requested a review from a team as a code owner April 9, 2025 23:16
:param volume: The volume of liquid to load into each well, in 10µL.
:param volume: The volume of liquid to load into each well. Must be a multiple of 10.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Making an assumption here that this meant the volume must be a multiple of 10... but I could be wrong.

Copy link
Member

Choose a reason for hiding this comment

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

No thats definitely just a typo. Should be a multiple of 1.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you!!

@ecormany ecormany added docs papi-v2 Python API V2 labels Apr 10, 2025
Copy link
Contributor

@ecormany ecormany left a comment

Choose a reason for hiding this comment

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

Good overall. Some small, but necessary, fixes remain. Tried to leave suggestions for all.

One open content question is whether we need to keep some mention of Well.load_liquid() in the article. It was in the API for a good long time (and still technically is) and I don't think we would want to imply that loading liquids is effectively only available in 2.23+.

@@ -298,18 +298,35 @@ The ``display_color`` parameter accepts a hex color code, which adds a color to
Labeling Wells and Reservoirs
=============================

This example uses ``load_liquid`` to label the initial well location, contents, and volume (in µL) for the liquid objects created by ``define_liquid``. Notice how values of the ``liquid`` argument use the variable names ``greenWater`` and ``blueWater`` (defined above) to associate each well with a particular liquid:
This example uses ``load_liquid`` to label the initial well location, contents, and volume (in µL) for the liquid objects created by ``define_liquid``. Notice how values of the ``liquid`` argument use the variable names ``greenWater`` and ``blueWater`` (defined above) to associate each labware with a particular liquid:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's important to note that the new Labware method still makes reference to individual wells — it's not all or nothing.

Suggested change
This example uses ``load_liquid`` to label the initial well location, contents, and volume (in µL) for the liquid objects created by ``define_liquid``. Notice how values of the ``liquid`` argument use the variable names ``greenWater`` and ``blueWater`` (defined above) to associate each labware with a particular liquid:
This example uses ``load_liquid`` to label the initial well location, contents, and volume (in µL) for the liquid objects created by ``define_liquid``. Notice how values of the ``liquid`` argument use the variable names ``greenWater`` and ``blueWater`` (defined above) to associate wells in each labware with a particular liquid:

Comment on lines 305 to 317
## load entire well plate with greenWater
well_plate.load_liquid(
wells=()[0],
volume=50,
liquid="greenWater"
)
## load entire reservoir with blueWater
reservoir.load_liquid(
wells=[A1],
volume=50,
liquid="blueWater"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix up this code so it simulates and has proper comment formatting.

Suggested change
## load entire well plate with greenWater
well_plate.load_liquid(
wells=()[0],
volume=50,
liquid="greenWater"
)
## load entire reservoir with blueWater
reservoir.load_liquid(
wells=[A1],
volume=50,
liquid="blueWater"
)
# load entire well plate with greenWater
plate.load_liquid(
wells=plate.wells(), # using accessor
volume=50,
liquid=greenWater
)
# load entire reservoir with blueWater
reservoir.load_liquid(
wells=["A1"], # using list of well names
volume=50,
liquid=blueWater
)

Comment on lines 323 to 324
well_plate.load_liquid_by_well({'A1': 200, 'A2': 100, 'A3': 50}, greenWater)
well_plate.load_liquid_by_well({'B1': 200, 'B2': 100, 'B3': 50}, blueWater)
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use plate as the labware name here too. Not sure why we had well_plate before — it doesn't match our docs template protocol.


.. versionadded:: 2.14
.. versionadded:: 2.23
Copy link
Contributor

Choose a reason for hiding this comment

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

Double checked and these were added in 2.22.

:param wells: The wells to load the liquid into.
:type wells: List of well names or list of Well objects, for instance from :py:meth:`~Labware.wells`.
:type wells: List of well names or list of Well objects- for instance, from :py:meth:`~Labware.wells`.
Copy link
Contributor

Choose a reason for hiding this comment

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

A little clearer on the types. And sewing up the clauses more neatly.

Suggested change
:type wells: List of well names or list of Well objects- for instance, from :py:meth:`~Labware.wells`.
:type wells: List of string well names or list of :py:class:`.Well` objects (e.g., from :py:meth:`~Labware.wells`).

If you want to mark the well as containing no liquid, use :py:meth:`~Labware.load_empty`.
This method should be called at the beginning of a protocol, soon after loading labware and before
liquid handling operations begin. Loading liquids is required for liquid tracking functionality- if a well
Copy link
Contributor

Choose a reason for hiding this comment

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

Same change here and other methods.

Suggested change
liquid handling operations begin. Loading liquids is required for liquid tracking functionality- if a well
liquid handling operations begin. Loading liquids is required for liquid tracking functionality. If a well

This method should be called at the beginning of a protocol, soon after loading labware and before
liquid handling operations begin. Loading liquids is required for liquid tracking functionality- if a well
hasn't been assigned a starting volume with :py:meth:`~Labware.load_empty`, :py:meth:`~Labware.load_liquid`, or
:py:meth:`~Labware.load_liquid_by_well`, the volume it contains is unknown and the well's liquid will not be tracked throughout the protocol.
Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose probing would also work, but the question is whether that's in scope for these docstrings.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmmmm. I think I'm team leave this as is. It is technically true that if you don't use any of the methods here to load liquid in your well, it won't be tracked throughout your protocol. Yes, you can probe the liquid at the beginning of the protocol or later, but feels maybe a bit can of worms to bring it up in the docstring.

@emilyburghardt
Copy link
Collaborator Author

Added another commit (updates based on feedback). @ecormany I did add in a versionadded and versionupdated message to tie back in Well.load_liquid. let me know what you think.

Also, still one build issue because of a meniscus ref- this one needs to be rebased on the branch and merged after the meniscus PR, or I just move the one sentence over to that PR.

.. versionadded:: 2.23
.. versionadded:: 2.14
Use ``Well.load_liquid()`` to label liquid in individual wells.
.. versionchanged:: 2.22
Copy link
Contributor

Choose a reason for hiding this comment

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

Python pedants would say this is versionadded. If you don't need another commit for some other reason, I don't care.

Comment on lines 329 to 333
.. deprecated:: 2.23

In API version 2.22 and later, use :py:meth:`.Labware.load_liquid`, :py:meth:`.Labware.load_liquid_by_well`,
or :py:meth:`.Labware.load_empty` to load liquid into a well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sneaky but this should be 2.22.

Suggested change
.. deprecated:: 2.23
In API version 2.22 and later, use :py:meth:`.Labware.load_liquid`, :py:meth:`.Labware.load_liquid_by_well`,
or :py:meth:`.Labware.load_empty` to load liquid into a well.
.. deprecated:: 2.22
Use :py:meth:`.Labware.load_liquid`, :py:meth:`.Labware.load_liquid_by_well`,
or :py:meth:`.Labware.load_empty` instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs papi-v2 Python API V2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants