nipype / pydra

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

RF: Change File and Directory to aliases of Path #651

Closed effigies closed 1 month ago

effigies commented 1 year ago

This attempts to replace File/Directory with TypeAliases, which I think is probably the only reasonable way to make Pydra type-checkable.

The File/Directory stuff is pretty magical. Something somewhere is changing the output_dir after using it to do input mapping when running container tasks, but I can't figure out where and I've run out of time to spend on this. Possibly someone else will see it.

ghisvail commented 1 year ago

Just out of curiosity, why can't File and Directory be aliases to os.PathLike?

effigies commented 1 year ago

Maybe we can. As a protocol, they're not instantiable, so I didn't want to add the complication, but maybe that will help us be more careful.

effigies commented 1 year ago

FWIW, we might be able to go back to NewType after the next typing_extensions release: https://github.com/python/typing_extensions/issues/156