Skip to content

Commit

Permalink
stub landing page, defining, using
Browse files Browse the repository at this point in the history
  • Loading branch information
ecormany committed Mar 15, 2024
1 parent eb19a5e commit 38cf0df
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 0 deletions.
49 changes: 49 additions & 0 deletions api/docs/v2/parameters/defining.rst
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
====================
18 changes: 18 additions & 0 deletions api/docs/v2/parameters/using_values.rst
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
27 changes: 27 additions & 0 deletions api/docs/v2/runtime-parameters.rst
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.

0 comments on commit 38cf0df

Please sign in to comment.