diff --git a/docs/contents/workers/user_configuration/list_config.png b/docs/contents/workers/user_configuration/list_config.png new file mode 100644 index 0000000000000000000000000000000000000000..37bfd9efe44bae4f14316709de511b420f1c735b Binary files /dev/null and b/docs/contents/workers/user_configuration/list_config.png differ diff --git a/docs/contents/workers/yaml.md b/docs/contents/workers/yaml.md index 68618b06e2f15e20c7877ce07710c9ca41decdb2..b3cc7fb6e459a0f03a817d930247f9ecf1836459 100644 --- a/docs/contents/workers/yaml.md +++ b/docs/contents/workers/yaml.md @@ -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.  @@ -228,6 +232,29 @@ Which will result in the following display for the user:  +#### 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: + + + + #### 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.