-
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
[WIP][ENH] Created BoutiquesTask for simiplified execution of Boutiques tools in Pydra #210
base: master
Are you sure you want to change the base?
Conversation
Thanks @ValHayot for the PR. I wanted to finally start working on Boutiques :) @satra and I were originally thinking about slightly different approach - reading boutiques spec and running the |
Either works, but I'd imagine that there'd be a bit of redundancy with I'm going to CC @glatard as he might have something to add. |
Running a Boutiques task through ShellCommand would require forking a shell to call the Boutiques interpreter that would then start another Python interpreter. I thought it would be lighter to just go through the Boutiques Python API. But of course it adds a dependency. |
i think this is a good starting point. some comments below.
@ValHayot - how would i select say the brain output of bet and the mask output of bet for downstream tasks. pydra is a dataflow engine so the key aspect of pydra is to be able to construct workflows. @glatard - going through the api is fine for now. the key thing we wanted to see is if we could give people a quick way to create neuroimaging workflows using the boutiques descriptors of tools. eventually we will convert the nipype interfaces to pydra tasks, but we are going to break away the tools into their own packages. i would also make boutiques an optional add on rather than a pydra dependency. pydra would put you in a cached working directory when the task is run. so in the above example, the second part of bosh_args would have to be filled in during the run. |
@ValHayot - I've been trying to work on you example, and I have several questions. Perhaps, two most important for the beginning:
Perhaps we could also chat one day if you find some time? |
Hey @djarecka , @satra , sorry for taking so long to get back to you. I wanted to fix my PR before replying so I could show you what I meant, and then got busy. Basically, when you run a task, it produces an Feel free to contact me. Should be a bit more available now :) |
@ValHayot - thanks for your answer! I was parsing How can I get |
@djarecka unfortunately the executor output object isn't saved from the CLI, but we could have than done quickly if you need it. In this way, output files wouldn't be known before they are produced though. If you to know which files will be produced before the tool is run,
would return all possible output files since the tool interface doesn't include conditional outputs. |
@glatard - I'm thinking what should be the best way to provide output_specification... One way would be to expect user to specify which output she/he expects and simply return error if the output is not created. @satra - do you have opinion? |
i think there are two questions implicit in this discussion:
@glatard and @djarecka - one is at the point of task creation, the other is after execution. i think (1) would come from the spec and (2) would come from some serialization of the executor object. |
@satra - so, I was more thinking about the first issue, that's why having the list of the output after execution doesn't really help. But the zenodo spec does not give you answer to this questions, since you have all possible outputs, doesn't take into account the list of argument provided to the command. That's why I've started thinking that maybe the user should be required to specify list of outputs (that would have to be a subset of list generated from the zenodo file) |
@djarecka just to be clear: it is possible for a Boutiques spec developer to map outputs to input values, this is done through conditional outputs. It is also possible that they specify outputs to be "optional", that is to appear without a specified relation with inputs. |
i think the zenodo spec gives you the answer to (1) just like nipype outputspec. but it does not give the answer to 2. nipype allows connecting any output independent of what the inputs are. whether that output carries a value is dependent on the execution of the interface. nipype does not impose the list_outputs condition on the workflow creator. |
@glatard - but I understand that the developer doesn't have to provide conditional outputs, at least in the fsl_bet example I don't see it @satra - if you are saying that it's ok to connect output that is not created during the execution of the task, then I could indeed create |
Yes you are right, conditional outputs are optional. |
Types of changes
Summary
Boutiques tools can be executed in Pydra, by, for example, executing a command such as :
Checklist
(we are using
black
: you canpip install pre-commit
,run
pre-commit install
in thepydra
directoryand
black
will be run automatically with each commit)Acknowledgment