-
Notifications
You must be signed in to change notification settings - Fork 536
Brainstorming on the migration of Nipype 1.0 interfaces (to Pydra)
Oscar Esteban edited this page Dec 30, 2019
·
3 revisions
After some playing around the input/output specs etc. during #3124, it seems that migrating the interfaces is a quite large undertaking.
Migrating the existing interfaces into Python callables. Although defining the __call__() method could work out, it would be desirable to make these ported functions more lightweight (and hopefully dropping many dependencies).
Input specs seem relatively easy to port:
- The
mandatorymetadata indicates positional arguments - The
usedefaultmetadata indicates when the input should be converted to a positional or a keyword argument. - The
positionmetadata could be passed in as a dictionary. - Trait types can be easily used to generate Python type-annotations.
- Filename generating metadata (
name_{template,source},genfile) is probably not hard to translate to keyword arguments with naming templates, or integrated with the ports for_parse_inputs()+_format_arg(). - Other behaviors:
-
_parse_inputs()+_format_arg(): will require a port, although it does not seem excessively hard. This could use a better design. -
exists: we might just go ahead without this one. -
traits.List/traits.Range: min/max etc could probably be dropped. -
desc: with #3124, these will be easy to integrate into the docstrings.
-
These seem trickier - there is generally very little metadata associated with the outputs. Moreover, the major issue is how to port the aggregate_outputs()+_list_outputs() functioning.
-
aggregate_outputs()seems easier to implement, as very few interfaces override it -
_list_outputs()is a lot harder to port, as most of the interfaces use it. One possibility, which would substantially improve Nipype 1.0 in the worst-case scenario, would be to add more metadata to the output specs (e.g.,globandretoFileandDirectoryso that they can collect patterns, and templated default values to build up names; orstdout/errmetadata to trigger parsing outputs). An early implementation of these new metadata could just point to functions (e.g.,gen_filename())
This should be fairly easy for CommandLine interfaces, but could be tricky for pure python interfaces.