Skip to content
Snippets Groups Projects

Add doc about list user configuration parameter

Merged Yoann Schneider requested to merge update-yaml-configuration-doc into master
1 file
+ 27
0
Compare changes
  • Side-by-side
  • Inline
@@ -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.
Loading