-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move file existence checks into field validators #649
Comments
If the file and directory classes inside fileformats are adopted by convention then this functionality is covered (+ magic number checking) when the objects are instantiated.
I didn't quite follow this, what is a "field" in this case. As I think we discussed with @djarecka and @ghisvail on another thread, to work nicely with fileformats, paths need to be somehow "cast" to the expected fileformat class. Not sure if this is related to what you are suggesting |
@effigies - I don't fully follow, what do you mean be "convert Paths into fields"? As for the validation, I think at the beginning we assumed that we want to distinguish between output file that would be a string in the |
Yeah, I'm not positive what words everyone uses. I'm pretty sure Not sure if this is clear... |
Sorry, still not 100% clear to me (but I'm struggling after an interrupted night's sleep). I like the idea of pydra.mark.task creating an However, if you use a |
On that note, it still bothers me that a field with Under |
Right now we have a weird special case for files and directories:
pydra/pydra/engine/specs.py
Lines 211 to 235 in 426564e
These would make more sense as validators on the fields themselves, rather than special-casing inside Pydra, as right now we are only capable of handling File/Directory and list of File/Directory.
To avoid losing functionality, we could improve the
@pydra.mark.task
decorator to convertPath
s intofields
with an existence check. And @tclose'scmd_arg
suggestion could probably help out by making these implicit, as well.The text was updated successfully, but these errors were encountered: