nipype / pydra

Pydra Dataflow Engine
https://nipype.github.io/pydra/
Other
119 stars 57 forks source link

Template typing in task interfaces #672

Open tclose opened 1 year ago

tclose commented 1 year ago

What would you like changed/added and why?

The ability to use template types (i.e. typing.TypeVar) when defining task interfaces, e.g.

@mask.task
def mytask(x: typing.T) -> typing.T:
    ...

What would be the benefit? Does the change make something easier to use?

The most important benefit would be to enable you to specify that a task operates on a generic object/files but returns the same type as it was passed

What would be required

tclose commented 1 year ago

@effigies I think this is all that would be required to add support for template typing, probably something that could be looked at in a future hack-week