@@ -23,56 +23,55 @@ pip install -e /path/to/pydra-fsl/[dev]
23
23
` FSLConverter ` class (from ` tools/converter.py ` ) requires three parts of information:
24
24
25
25
- Nipype spec: converter loads nipype interface and reads ` _cmd ` , ` input_spec ` and ` output_spec `
26
- - yml file with additional spec: ` specs/fsl_{module_name}_params.yml ` contains additional spec that are written based
26
+ - yml file with additional spec: ` specs/fsl_{module_name}_params.yml ` contains additional spec that are written based
27
27
on additional functions from nipype (including ` list_outputs ` ), each interface can have the following fields:
28
- - inputs_metadata: additional metadata for fields from input_spec
29
- (it will be included in ` metadata ` in pydra spec),
30
- e.g., used in ` specs/fsl_preprocess_params.yml ` for ` FAST ` to set default value for ` number_classes `
28
+ - inputs_metadata: additional metadata for fields from input_spec
29
+ (it will be included in ` metadata ` in pydra spec),
30
+ e.g., used in ` specs/fsl_preprocess_params.yml ` for ` FAST ` to set default value for ` number_classes `
31
31
(it's not part of nipype's spec, but it's set in ` list_output ` )
32
32
33
- - output_requirements: providing required fields for the output to be created,
34
- taken from `list_output` structure;
33
+ - output_requirements: providing required fields for the output to be created,
34
+ taken from `list_output` structure;
35
35
it's a part of the `requires` field in metadata in pydra spec
36
-
37
- - output_templates: providing template to create the output file name,
38
- taken from `list_output` structure;
36
+
37
+ - output_templates: providing template to create the output file name,
38
+ taken from `list_output` structure;
39
39
it is set as `output_file_template` in metadata
40
-
40
+
41
41
- output_callables: providing function name that should be used to gather output,
42
42
based on the `list_output` structure and used only for `FAST`;
43
43
it is set as `callable` in metadata
44
-
45
- - tests_inputs, tests_outputs: specification for tests,
46
- the fields should have the same length and each element should contain
44
+
45
+ - tests_inputs, tests_outputs: specification for tests,
46
+ the fields should have the same length and each element should contain
47
47
the input fields values and list of the expected output fields names
48
-
48
+
49
49
- doctests: specification for doctest,
50
- should include values for input fields and the expected `cmdline`
50
+ should include values for input fields and the expected `cmdline`
51
51
52
- - python file with functions used as callables to gather the outputs:
52
+ - python file with functions used as callables to gather the outputs:
53
53
` specs/callables.py ` should contain all the functions from ` output_callables ` ;
54
54
the source code of the functions is read and written again in the pydra interface file
55
55
56
56
57
57
### How to use the convert
58
58
59
59
The converter can be used by running:
60
-
60
+
61
61
python tools/converter.py --interface_name <name of teh interface> --module_name <module_name>
62
62
63
63
The pydra task will be created and saved in ` pydra/tasks/fsl/{module_name}/{interface_name}.py ` .
64
64
Note, that the spec file has to be present for the specific module name in order to run the converter.
65
65
If no ` interface_name ` is provided, the default value ` all ` will be used
66
66
and the converter will be run for all interfaces from the spec file.
67
67
68
- Tests are written based on the fields from the yml file:
68
+ Tests are written based on the fields from the yml file:
69
69
` tests_inputs ` and ` tests_outputs ` (the lengths should be the same).
70
70
One test, ` test_specs_* ` checks only the correctness of the spec based
71
71
on the ` test_inputs/outputs ` pairs, i.e. predicts which output fields
72
72
should be created based on the list of the input fields.
73
- The second test, ` test_run_* ` should run the interfaces
74
- (TODO: this is temporary, should be removed from the final repo).
73
+ The second test, ` test_run_* ` should run the interfaces
74
+ (TODO: this is temporary, should be removed from the final repo).
75
75
Tests can be run using ` pytest ` :
76
76
77
77
pytest -vs pydra/tasks/fsl/{module_name}/tests
78
-
0 commit comments