Skip to content

Commit

Permalink
order of setting rtps, analysis, reading offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
ecormany committed May 16, 2024
1 parent 1a45161 commit 56c0a42
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions api/docs/v2/parameters/using_values.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,25 @@ Since ``params`` is only available within the ``run()`` function, there are cert
- In the ``add_parameters()`` function.
* - Non-nested function definitions
- Anywhere outside of ``run()``.

Additionally, keep in mind that updated parameter values are applied by reanalyzing the protocol. This means you can't depend on updated values for any action that takes place *prior to reanalysis*.

An example of such an action is applying labware offset data. Say you have a parameter that changes the type of well plate you load in a particular slot::

# within add_parameters()
parameters.add_str(
variable_name="plate_type",
display_name="Well plate type",
choices=[
{"display_name": "Corning", "value": "corning_96_wellplate_360ul_flat"},
{"display_name": "NEST", "value": "nest_96_wellplate_200ul_flat"},
],
default="corning_96_wellplate_360ul_flat",
)

# within run()
plate = protocol.load_labware(
load_name="protocol.params.plate_type", location="D2"
)

When performing run setup, you're prompted to apply offsets before selecting parameter values. This is your only opportunity to apply offsets, so they're applied for the default parameter values — in this case, the Corning plate. If you then switch the value of ``plate_type`` to the NEST plate, the NEST plate will have default offset values (0.0 on all axes). You can fix this by running Labware Position Check, since it takes place after reanalysis, or by using :py:meth:`.Labware.set_offset` in your protocol.

0 comments on commit 56c0a42

Please sign in to comment.