Skip to content

Commit 4dd2a2d

Browse files
committed
updating readme
1 parent b2c0084 commit 4dd2a2d

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

README.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,41 +26,51 @@ pip install /path/to/pydra-fsl/
2626
- Nipype spec: converter loads nipype interface and reads `_cmd`, `input_spec` and `output_spec`
2727
- yml file with additional spec: `specs/fsl_conv_params.yml` contains additional spec that are written based
2828
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`
3132
(it's not part of nipype's spec, but it's set in `list_output`)
3233

33-
- output_requirements: providing required field for the output to be created,
34+
- output_requirements: providing required fields for the output to be created,
3435
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
3637

3738
- output_templates: providing template to create the output file name,
3839
taken from `list_output` structure;
3940
it is set as `output_file_template` in metadata
4041

4142
- output_callables: providing function name that should be used to gather output,
4243
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`
4452

4553
- python file with functions used as callables to gather the outputs:
4654
`specs/callables.py` should contain all the functions from `output_callables`;
4755
the source code of the functions is read and written again in the pydra interface file
4856

4957

50-
### How to convert
58+
### How to use the convert
5159

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`
5865

5966
Tests are written based on the fields from the yml file:
6067
`tests_inputs` and `tests_outputs` (the lengths should be the same).
6168
One test, `test_specs_*` checks only the correctness of the spec based
6269
on the `test_inputs/outputs` pairs, i.e. predicts which output fields
6370
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
6676

0 commit comments

Comments
 (0)