Skip to content

Commit

Permalink
adding csv parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ecormany committed Aug 7, 2024
1 parent d3eac90 commit cf8118b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 22 additions & 1 deletion api/docs/v2/parameters/defining.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ Within this function definition, call methods on ``parameters`` to define parame
Types of Parameters
===================

The API supports four types of parameters: Boolean (:py:class:`bool`), integer (:py:class:`int`), floating point number (:py:class:`float`), and string (:py:class:`str`). It is not possible to mix types within a single parameter.
The API supports four types of parameters that correspond to Python built-in types: Boolean (:py:class:`bool`), integer (:py:class:`int`), floating point number (:py:class:`float`), and string (:py:class:`str`). It is not possible to mix types within a single parameter.

In addition, starting in version 2.20, the API supports CSV files as parameters. All data contained in CSV parameters, including numeric data, is initially interpreted as strings. See :ref:`using-rtp-types` for more information on manipulating CSV values.

Boolean Parameters
------------------
Expand Down Expand Up @@ -179,3 +181,22 @@ A common use for string display names is to provide an easy-to-read version of a
During run setup, the technician can choose from a menu of the provided choices.

.. versionadded:: 2.18

CSV Parameters
--------------

CSV parameters accept any valid comma-separated file. You don't need to specify the format of the data. Due to this flexibility, they do not have default values.

Briefly describe the purpose of your CSV parameter when defining it.

.. code-block::
parameters.add_csv_file(
variable_name="cherrypicking_wells",
display_name="Cherrypicking wells",
description="Table of labware, wells, and volumes to transfer."
)
Separately provide standard operating procedures or template files to the scientists and technicians who will create the tabular data your protocol relies on.

.. versionadded:: 2.20
2 changes: 2 additions & 0 deletions api/docs/v2/parameters/using_values.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Then ``params`` will gain three attributes: ``params.dry_run``, ``params.sample_
You can also save parameter values to variables with names of your choosing.

.. _using-rtp-types:

Parameter Types
===============

Expand Down

0 comments on commit cf8118b

Please sign in to comment.