-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
:og:description: Define and set possible values for parameters in Opentrons Python protocols. | ||
|
||
.. _defining-rtp: | ||
|
||
******************* | ||
Defining Parameters | ||
******************* | ||
|
||
.. dunno if this will be a named intro section or just some text at the top | ||
Parameters all have: | ||
|
||
- A ``variable_name`` for referencing in code. | ||
- A ``display_name`` to label them in the Opentrons App or on the touchscreen. | ||
- An optional ``description`` to provide more information about how the parameter will affect the execution of the protocol. | ||
- A ``default`` value that the protocol will use if no changes are made during run setup. | ||
|
||
Numeric and string parameters have additional attributes. See below. | ||
|
||
The ``add_parameters()`` Function | ||
================================= | ||
|
||
Types of Parameters | ||
=================== | ||
|
||
Boolean Parameters | ||
------------------ | ||
|
||
Boolean parameters are ``True`` or ``False``. During setup, they appear as *On* or *Off*, respectively. | ||
|
||
Integer Parameters | ||
------------------ | ||
|
||
Enter an integer within a range or choose from a list of options. | ||
|
||
Float Parameters | ||
---------------- | ||
|
||
Enter a floating point number within a range or choose from a list of options. | ||
|
||
|
||
String Parameters | ||
----------------- | ||
|
||
Enumerated only. Choose from a list of predefined strings. | ||
|
||
|
||
What to Parameterize | ||
==================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
:og:description: Access parameter values in Opentrons Python protocols. | ||
|
||
.. _using-rtp: | ||
|
||
**************** | ||
Using Parameters | ||
**************** | ||
|
||
The ``params`` object | ||
===================== | ||
|
||
Other topics TK | ||
=============== | ||
|
||
To fill in later: | ||
|
||
- Type checking | ||
- TKTKTK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
:og:description: Define and customize parameters in Opentrons Python protocols. | ||
|
||
.. _runtime-parameters: | ||
|
||
****************** | ||
Runtime Parameters | ||
****************** | ||
|
||
.. toctree:: | ||
parameters/defining | ||
parameters/using_values | ||
parameters/use_case_sample_count | ||
parameters/use_case_dry_run | ||
parameters/style | ||
|
||
Runtime parameters let you define user-customizable variables in your Python protocols. This gives you greater flexibility and puts extra control in the hands of the technician running the protocol — without forcing them to switch between lots of protocol files or write code themselves. | ||
|
||
This section begins with the fundamentals of runtime parameters: | ||
|
||
- :ref:`Defining parameters <defining-rtp>`: the syntax for setting up boolean, numeric, and string-based parameters. | ||
- :ref:`Using parameter values <using-rtp>`: how and when to reference what the user has chosen. | ||
|
||
It continues with a selection of use cases and some overall style guidance. When adding parameters to your protocol, you are in charge of the user experience when it comes time to set up the protocol! These pages outline best practices for making your protocols reliable and easy to use. | ||
|
||
- Use case – sample count: Change behavior throughout a protocol based on how many samples you plan to process. Setting sample count exactly saves time, tips, and reagents. | ||
- Use case – dry run: Test your protocol, instead of doing a live run, just by flipping a toggle. | ||
- Style and usage: When you're a protocol author, you write code. When you're a parameter author, you write words. Follow this advice to make things as clear as possible for your protocol users/readers. |