nipype / pydra

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

Catch inadvertent `attrs.NOTHING` file outputs and raise error #749

Open tclose opened 2 months ago

tclose commented 2 months ago

What would you like changed/added and why? Currently, if there is an issue with file output handling by a task and a file path is not set correctly, it is implicitly converted to attrs.NOTHING. While this is useful behaviour for optional outputs, for mistakenly set paths it can be extremely confusing to the user as it appears that the downstream nodes haven't had their inputs set despite them being connected to lzout fields.

We should specify when a file field is truly optional, and perhaps return None instead of attrs.NOTHING so it is obvious to the downstream node that the file hasn't been generated by the upstream node, instead of just not set at all

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

Easier to debug workflows

tclose commented 2 months ago

We should also do this for inputs at execution time too. Using the File | None union type should coerce properly