Skip to content
Snippets Groups Projects
Commit fe45cef9 authored by Yoann Schneider's avatar Yoann Schneider :tennis: Committed by Bastien Abadie
Browse files

Add doc about list user configuration parameter

parent c825e435
No related branches found
No related tags found
1 merge request!274Add doc about list user configuration parameter
Pipeline #79915 passed
docs/contents/workers/user_configuration/list_config.png

91.2 KiB

......@@ -120,6 +120,7 @@ A parameter is defined using the following settings:
- `float`
- `string`
- `enum`
- `list`
- `dict`
`default`
......@@ -131,6 +132,9 @@ A parameter is defined using the following settings:
`choices`
: Optional. A list of options for `enum` type parameters.
`subtype`
: Optional. The type of the elements of `list` type parameters.
This definition allows for both validation of the input and the display of a form to make configuring workers easy for Arkindex users.
![User configuration](user_configuration/configuration_form.png "User configuration form on Arkindex")
......@@ -228,6 +232,29 @@ Which will result in the following display for the user:
![Enum-type parameter](user_configuration/enum_config.png "Example enum-type parameter.")
#### List parameters
List-type parameters must be defined using a `title`, the `list` `type` and a `subtype` for the elements inside the list. You can also set a `default` value for this parameter, which must be a list containing elements of the given `subtype`, as well as make it a `required` parameter, which prevents users from leaving it blank.
The allowed `subtype`s are `int`, `float` and `string`.
In the configuration form, list parameters are displayed as rows of input fields.
For example, a list-type parameter can be defined like this:
```yaml
a_list:
title: A List of Values
type: list
subtype: int
default: [4, 3, 12]
```
Which will result in the following display for the user:
![List-type parameter](user_configuration/list_config.png "Example list-type parameter.")
#### Dictionary parameters
Dictionary-type parameters must be defined using a `title`, the `dict` `type`. You can also set a `default` value for this parameter, which must be one a dictionary, as well as make it a `required` parameter, which prevents users from leaving it blank. You can use dictionary parameters for example to specify a correspondence between the classes that are predicted by a worker and the elements that are created on Arkindex from these predictions.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment