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

docs(api): new_modules.rst revsions for Flex #13143

Closed
wants to merge 47 commits into from

Conversation

jwwojak
Copy link
Contributor

@jwwojak jwwojak commented Jul 20, 2023

Overview

Suggested text and code example revisions to the Modules API docs (new_modules.rst file) to include Flex code and code examples.

Test Plan

  • Checked links and cross-references to make sure they work.
  • Code changes are minor. For example, adding new code samples to show labware in a Flex deck slot is just a change from 1 (OT-2) to D1 (Flex).
  • Some anchors and other links depend on changes pending in PR 13096.

Changelog

  • Adds Flex and OT-2 code samples to the docs.
  • Some new subsections.

Review requests

Check for proper Python usage and writing/style.

Risk assessment

Low, documentation changes and code samples only.

@jwwojak jwwojak added the docs label Jul 20, 2023
@jwwojak jwwojak requested a review from ecormany July 20, 2023 18:44
@jwwojak jwwojak self-assigned this Jul 20, 2023
@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Merging #13143 (f99ff93) into edge (0b7f943) will decrease coverage by 0.13%.
Report is 28 commits behind head on edge.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #13143      +/-   ##
==========================================
- Coverage   72.56%   72.44%   -0.13%     
==========================================
  Files        2391     2357      -34     
  Lines       65946    64895    -1051     
  Branches     7306     7202     -104     
==========================================
- Hits        47857    47013     -844     
+ Misses      16344    16143     -201     
+ Partials     1745     1739       -6     
Flag Coverage Δ
g-code-testing 96.44% <ø> (ø)
notify-server 89.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 53 files with indirect coverage changes

Removing commented text. Adjusting code samples.
Changes to deck slot note and put module methods in a bullet list under the "Additional labware parameters" section.
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.

Tons of comments, but this is coming along nicely. I think our big question is whether this has gotten too unwieldy for a single page and we want to split it in this PR.

api/docs/v2/new_modules.rst Outdated Show resolved Hide resolved
api/docs/v2/new_modules.rst Show resolved Hide resolved
api/docs/v2/new_modules.rst Outdated Show resolved Hide resolved
api/docs/v2/new_modules.rst Outdated Show resolved Hide resolved
| GEN1 | | |
+--------------------+-------------------------------+---------------------------+

Some modules were added to our python API later than others, and others span multiple hardware generations. When writing a protocol that requires a module, make sure your ``requirements`` or ``metadata`` code block specifies a :ref:`Protocol API version <v2-versioning>` high enough to support all the module generations you want to use.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to add another table or list here to indicate which modules are usable on Flex vs. OT-2? Expanding this table out to 5 columns would be a bit 😵‍💫

Leaning towards list because we can say "Flex supports HS, Temp 2, TC 2, and Mag Block only. OT-2 supports everything except Mag Block"

Copy link
Contributor Author

@jwwojak jwwojak Jul 25, 2023

Choose a reason for hiding this comment

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

Ouch, a 5-column table would be too much. I wonder if adding more text adds complexity without help. Instead, it may be simpler to call out a module only when it doesn't work with a particular robot.

For example, the draft already does this now with the Magnetic Module and Magnetic Block. There's a note under the section header that says, "Recommended for use with insert robot here only."

Unless we say something, the default assumption (dangerous) should be all modules work with all robots unless indicated otherwise.

api/docs/v2/new_modules.rst Outdated Show resolved Hide resolved
def run(protocol_api.ProtocolContext):
mag_block = protocol.load_module('magneticBlockV1', 'D1')

.. load something on the magnetic block here example.
Copy link
Contributor

Choose a reason for hiding this comment

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

can be part of the above snippet. it uses load_labware() like all other module contexts.

api/docs/v2/new_modules.rst Show resolved Hide resolved

In order to send commands to the correct module on the deck, you need to load the modules in your protocol in a specific order. Whenever you call :py:meth:`.load_module` for a particular module type, the OT-2 will initialize the matching module attached to the lowest-numbered USB port. Deck slot numbers play no role in the ordering of modules; you could load a Temperature Module in slot 4 first, followed by another one in slot 3:
In order to send commands to the correct module on the deck, you need to load the modules in your protocol in a specific order. Whenever you call :py:meth:`.load_module` for a particular module type, the robot will initialize the matching module attached to the lowest-numbered USB port. Deck slot numbers play no role in the ordering of modules; you could load a Temperature Module in slot C1 first, followed by another one in slot D3:
Copy link
Contributor

Choose a reason for hiding this comment

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

the notion here was to have the "higher" number slot load first. so maybe D1 first, then C1, or something like that. (there's less of an obvious ordering with coordinate slots than numeric slots)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is a good idea. I will try to make it more clear in the text. As you note, it is tricky with Flex because of the alphanumeric deck system. Visually row D is first or closest to the user, followed by C, but C comes before D in the alphabet. I will use an example with a module in D3/usb 2 and C1 usb 6 (to match the usb connections on the image) to show how a module on D3 would load before C1 because of the usb port number.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed revisions to draft this morning.

.. image:: ../img/modules/multiples_of_a_module.svg

Before running your protocol, it's a good idea to use the module controls in the Opentrons App to check that commands are being sent where you expect.

For additional information, including using modules with USB hubs, see our `support article on Using Multiple Modules of the Same Type <https://support.opentrons.com/s/article/Using-modules-of-the-same-type-on-the-OT-2>`_.
.. Does the support article apply to Flex?
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 check with support.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ecormany ecormany added the papi-v2 Python API V2 label Jul 24, 2023
jwwojak and others added 18 commits July 24, 2023 15:10
Mid-afternoon push.
Pushing end of day draft.
Multiple modules / same type section.
More revisions. Finished for now with this section. Checking comments.
Once more on this section. Moving on after this.
Committed.

Co-authored-by: Ed Cormany <[email protected]>
Committed.

Co-authored-by: Ed Cormany <[email protected]>
Committed.

Co-authored-by: Ed Cormany <[email protected]>
Committing

Co-authored-by: Ed Cormany <[email protected]>
Committing change

Co-authored-by: Ed Cormany <[email protected]>
Adding to batch commit.

Co-authored-by: Ed Cormany <[email protected]>
Committing

Co-authored-by: Ed Cormany <[email protected]>
Pulling batch commit and pushing stashed changes.
Adding `from opentrons import` statement to code samples.
More revisions and end of day push.
Another draft for review. final_final_final ? maybe?
@ecormany
Copy link
Contributor

Closing in favor of #13183 🚚

@ecormany ecormany closed this Jul 27, 2023
@jwwojak jwwojak deleted the hardware-modules-docs-revisons branch July 31, 2023 15:47
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.

2 participants