@@ -35,14 +35,14 @@ Let's start from the previous example:
3535
3636
3737 In order to create an input specification, a new `SpecInfo ` object has to be created.
38- The field `name ` specifiest the typo of the spec and it should be always "Input" for
38+ The field `name ` specifies the type of the spec and it should be always "Input" for
3939the input specification.
4040The field `bases ` specifies the "base specification" you want to use (can think about it as a
4141`parent class `) and it will usually contains `ShellSpec ` only, unless you want to build on top of
4242your other specification (this will not be cover in this section).
4343The part that should be always customised is the `fields ` part.
4444Each element of the `fields ` is a separate input field that is added to the specification.
45- In this example, a three-elements tuples - with name, type and dictionary with additional
45+ In this example, three-elements tuples - with name, type and dictionary with additional
4646information - are used.
4747But this is only one of the supported syntax, more options will be described below.
4848
@@ -86,9 +86,25 @@ However, we allow for shorter syntax, that does not include `attr.ib`:
8686
8787Each of the shorter versions will be converted to the `(name, attr.ib(... )`.
8888
89+
90+ Types
91+ ---- -
92+
8993Type can be provided as a simple python type (e.g. `str ` , `int ` , `float ` , etc.)
9094or can be more complex by using `typing.List` , `typing.Dict` and `typing.Union` .
9195
96+ There are also special types provided by Pydra:
97+
98+ - `File` and `Directory` - should be used in `input_spec` if the field is an existing file
99+ or directory.
100+ Pydra checks if the file or directory exists, and returns an error if it doesn' t exist.
101+
102+
103+ - `MultiInputObj` - a special type that takes a any value and if the value is not a list it
104+ converts value to a 1 - element list (it could be used together with `MultiOutputObj`
105+ in the `output_spec` to reverse the conversion of the output values).
106+
107+
92108
93109Metadata
94110--------
@@ -126,9 +142,6 @@ In the example we used multiple keys in the metadata dictionary including `help_
126142`xor` (`list ` ):
127143 List of field names that are mutually exclusive with the field.
128144
129- `keep_extension` (`bool ` , default: `True ` ):
130- A flag that specifies if the file extension should be removed from the field value.
131-
132145`copyfile` (`bool ` , default: `False ` ):
133146 If `True ` , a hard link is created for the input file in the output directory.
134147 If hard link not possible, the file is copied to the output directory.
@@ -139,9 +152,16 @@ In the example we used multiple keys in the metadata dictionary including `help_
139152`output_file_template` (`str ` ):
140153 If provided, the field is treated also as an output field and it is added to the output spec.
141154 The template can use other fields, e.g. `{file1}` .
155+ Used in order to create an output specification.
142156
143157`output_field_name` (`str ` , used together with `output_file_template` )
144158 If provided the field is added to the output spec with changed name.
159+ Used in order to create an output specification.
160+
161+ `keep_extension` (`bool ` , default: `True ` ):
162+ A flag that specifies if the file extension should be removed from the field value.
163+ Used in order to create an output specification.
164+
145165
146166`readonly` (`bool ` , default: `False ` ):
147167 If `True ` the input field can' t be provided by the user but it aggregates other input fields
0 commit comments