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