Skip to content

Commit e7ed61b

Browse files
jwwojakecormany
andauthored
docs(api): Flex revisions for Advanced Control (#13346)
* Make robot references generic for both models Say either "Flex and OT-2" or just "the robots". * Apply suggestions from code review Co-authored-by: Ed Cormany <[email protected]> * Fixing examples and quote marks Changed the protocol example to OT-2 to match the API level 2.13. Remove ' ' in favor of " " --------- Co-authored-by: Ed Cormany <[email protected]>
1 parent 5144fec commit e7ed61b

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

api/docs/v2/new_advanced_running.rst

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ Advanced Control
77

88
As its name implies, the Python Protocol API is primarily designed for creating protocols that you upload via the Opentrons App and execute on the robot as a unit. But sometimes it's more convenient to control the robot outside of the app. For example, you might want to have variables in your code that change based on user input or the contents of a CSV file. Or you might want to only execute part of your protocol at a time, especially when developing or debugging a new protocol.
99

10-
The OT-2 offers two ways of issuing Python API commands to the robot outside of the app: through Jupyter Notebook or on the command line with ``opentrons_execute``.
10+
The Python API offers two ways of issuing commands to the robot outside of the app: through Jupyter Notebook or on the command line with ``opentrons_execute``.
1111

1212
Jupyter Notebook
1313
----------------
1414

15-
The OT-2 runs a `Jupyter Notebook <https://jupyter.org>`_ server on port 48888, which you can connect to with your web browser. This is a convenient environment for writing and debugging protocols, since you can define different parts of your protocol in different notebook cells and run a single cell at a time.
15+
The Flex and OT-2 run `Jupyter Notebook <https://jupyter.org>`_ servers on port 48888, which you can connect to with your web browser. This is a convenient environment for writing and debugging protocols, since you can define different parts of your protocol in different notebook cells and run a single cell at a time.
1616

1717
.. note::
18-
The Jupyter Notebook server only supports Python Protocol API versions 2.13 and earlier. Use the Opentrons App to run protocols that require functionality added in newer versions.
18+
Currently, the Jupyter Notebook server does not work with Python Protocol API versions 2.14 and 2.15. It does work with API versions 2.13 and earlier. Use the Opentrons App to run protocols that require functionality added in newer versions.
1919

20-
Access the OT-2’s Jupyter Notebook by either:
20+
Access your robot's Jupyter Notebook by either:
2121

2222
- Going to the **Advanced** tab of Robot Settings and clicking **Launch Jupyter Notebook**.
2323
- Going directly to ``http://<robot-ip>:48888`` in your web browser (if you know your robot's IP address).
2424

25-
Once you've launched Jupyter Notebook, you can create a notebook file or edit an existing one. These notebook files are stored on the OT-2 itself. If you want to save code from a notebook to your computer, go to **File > Download As** in the notebook interface.
25+
Once you've launched Jupyter Notebook, you can create a notebook file or edit an existing one. These notebook files are stored on the the robot. If you want to save code from a notebook to your computer, go to **File > Download As** in the notebook interface.
2626

2727
Protocol Structure
2828
^^^^^^^^^^^^^^^^^^
@@ -34,7 +34,7 @@ Rather than writing a ``run`` function and embedding commands within it, start
3434
.. code-block:: python
3535
3636
import opentrons.execute
37-
protocol = opentrons.execute.get_protocol_api('2.13')
37+
protocol = opentrons.execute.get_protocol_api("2.13")
3838
protocol.home()
3939
4040
The first command you execute should always be :py:meth:`~opentrons.protocol_api.ProtocolContext.home`. If you try to execute other commands first, you will get a ``MustHomeError``. (When running protocols through the Opentrons App, the robot homes automatically.)
@@ -54,11 +54,11 @@ You can also use Jupyter to run a protocol that you have already written. To do
5454
# the contents of your previously written protocol go here
5555
5656
57-
Since a typical protocol only `defines` the ``run`` function but doesn't `call` it, this won't immediately cause the OT-2 to move. To begin the run, instantiate a :py:class:`.ProtocolContext` and pass it to the ``run`` function you just defined:
57+
Since a typical protocol only `defines` the ``run`` function but doesn't `call` it, this won't immediately cause the robot to move. To begin the run, instantiate a :py:class:`.ProtocolContext` and pass it to the ``run`` function you just defined:
5858

5959
.. code-block:: python
6060
61-
protocol = opentrons.execute.get_protocol_api('2.13')
61+
protocol = opentrons.execute.get_protocol_api("2.13")
6262
run(protocol) # your protocol will now run
6363
6464
.. _using_lpc:
@@ -81,38 +81,38 @@ Creating the dummy protocol requires you to:
8181
4. Load your smallest capacity pipette and specify its ``tipracks``.
8282
5. Call ``pick_up_tip()``. Labware Position Check can't run if you don't pick up a tip.
8383

84-
For example, the following dummy protocol will use a Flex 50 µL pipette to enable Labware Position Check for a Flex tip rack, NEST reservoir, and NEST flat well plate.
84+
For example, the following dummy protocol will use a P300 Single-Channel GEN2 pipette to enable Labware Position Check for an OT-2 tip rack, NEST reservoir, and NEST flat well plate.
8585

8686
.. code-block:: python
8787
88-
requirements = {'apiLevel': '|apiLevel|', 'robotType': 'Flex'}
89-
90-
def run(protocol):
91-
tips = protocol.load_labware('opentrons_flex_96_tiprack_50ul', 'D1')
92-
reservoir = protocol.load_labware('nest_12_reservoir_15ml', 'D2')
93-
plate = protocol.load_labware('nest_96_wellplate_200ul_flat', 'D3')
94-
pipette = protocol.load_instrument('flex_1channel_50', 'left', tip_racks=[tips])
95-
pipette.pick_up_tip()
96-
pipette.return_tip()
88+
metadata = {"apiLevel": "2.13"}
89+
90+
def run(protocol):
91+
tiprack = protocol.load_labware("opentrons_96_tiprack_300ul", 1)
92+
reservoir = protocol.load_labware("nest_12_reservoir_15ml", 2)
93+
plate = protocol.load_labware("nest_96_wellplate_200ul_flat", 3)
94+
p300 = protocol.load_instrument("p300_single_gen2", "left", tip_racks=[tiprack])
95+
p300.pick_up_tip()
96+
p300.return_tip()
9797
9898
After importing this protocol to the Opentrons App, run Labware Position Check to get the x, y, and z offsets for the tip rack and labware. When complete, you can click **Get Labware Offset Data** to view automatically generated code that uses :py:meth:`.set_offset` to apply the offsets to each piece of labware.
9999

100100
.. code-block:: python
101101
102-
labware_1 = protocol.load_labware("opentrons_flex_96_tiprack_200ul", location="D1")
102+
labware_1 = protocol.load_labware("opentrons_96_tiprack_300ul", location="1")
103103
labware_1.set_offset(x=0.00, y=0.00, z=0.00)
104104
105-
labware_2 = protocol.load_labware("nest_12_reservoir_15ml", location="D2")
105+
labware_2 = protocol.load_labware("nest_12_reservoir_15ml", location="2")
106106
labware_2.set_offset(x=0.10, y=0.20, z=0.30)
107107
108-
labware_3 = protocol.load_labware("nest_96_wellplate_200ul_flat", location="D3")
108+
labware_3 = protocol.load_labware("nest_96_wellplate_200ul_flat", location="3")
109109
labware_3.set_offset(x=0.10, y=0.20, z=0.30)
110110
111111
This automatically generated code uses generic names for the loaded labware. If you want to match the labware names already in your protocol, change the labware names to match your original code:
112112

113113
.. code-block:: python
114114
115-
reservoir = protocol.load_labware('nest_12_reservoir_15ml', 'D2')
115+
reservoir = protocol.load_labware("nest_12_reservoir_15ml", "2")
116116
reservoir.set_offset(x=0.10, y=0.20, z=0.30)
117117
118118
.. versionadded:: 2.12
@@ -145,7 +145,7 @@ To disable the robot server, open a Jupyter terminal session by going to **New >
145145
Command Line
146146
------------
147147

148-
The OT-2's command line is accessible either by going to **New > Terminal** in Jupyter or `via SSH <https://support.opentrons.com/s/article/Connecting-to-your-OT-2-with-SSH>`_.
148+
The robot's command line is accessible either by going to **New > Terminal** in Jupyter or `via SSH <https://support.opentrons.com/s/article/Connecting-to-your-OT-2-with-SSH>`_.
149149

150150
To execute a protocol from the robot's command line, copy the protocol file to the robot with ``scp`` and then run the protocol with ``opentrons_execute``:
151151

@@ -154,4 +154,4 @@ To execute a protocol from the robot's command line, copy the protocol file to t
154154
opentrons_execute /data/my_protocol.py
155155

156156

157-
By default, ``opentrons_execute`` will print out the same run log shown in the Opentrons App, as the protocol executes. It also prints out internal logs at the level ``warning`` or above. Both of these behaviors can be changed; for further details, run ``opentrons_execute --help``.
157+
By default, ``opentrons_execute`` will print out the same run log shown in the Opentrons App, as the protocol executes. It also prints out internal logs at the level ``warning`` or above. Both of these behaviors can be changed. Run ``opentrons_execute --help`` for more information.

0 commit comments

Comments
 (0)