-
Notifications
You must be signed in to change notification settings - Fork 185
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
Runtime test of command-line parsing #2679
Comments
Yes, that is what I had in mind.
Yes, that would be sufficient
That would be fine for my use case. I could see it being useful for other use cases, but file format checking is to be handled in Pydra using my fileformats package in any case.
I'm not fussed on the mechanism to trigger the behaviour. It just needs to be used during CI, so an environment variable would probably be more convenient. |
Couple of clarifications:
It's actually slightly worse than that. The
MRtrix3 uses any number of dashes. We don't distinguish between Nonetheless, assuming we do want to have some means to running through
which would detect when We could then insert a quick check in core/command.h at line 101:
We'd need to declare |
Thanks @jdtournier, that all sounds good to me |
I can have a go at including it in my PR if that would be appropriate |
Correct; feature request is #1975.
The Python CLI has some limited flagging of option mutual exclusivity that operates at the point of command-line parsing. Would be possible to do similar in C++, but doesn't currently exist.
But if it's going to be used exclusively during CI, that seems to suit? It feels more tailored / less hacky to me than doing increments / decrements on
OK, you got me. "Hidden usages"?
I basically always advocate for independent PRs rather than concatenating commits, even if I don't always obey it myself. Can use a feature branch as the destination branch of the PR merge if it makes more sense. It just protects against conversations crossing over one another. |
Good point. It'll depend on how that integrates into the CI. If it's relying on the But what I meant here is that an additional argument is much more visible than a environment variable. If someone accidentally left it set earlier in the session, it could cause a fair bit of confusion down the track when trying to actually run something. Most of our environment variables affect some aspect of how the commands run, but this one would prevent them from running altogether, which is why I'd prefer an argument / option. Not a massive deal either way, to be fair...
🤣 OK, that might have come across as a touch pedantic... Reason I mention is because I initially started thinking of solutions based on the idea that these were options, and it took me a while to twig that they weren't. 🤷♂️ |
The plan is to put it in a GH action so env var would work, and would actually be easier. It could also be nice to have the test there to run "live" (non dry run) tests. Although how to handle the test data in that case might be tricky. |
The other option is to just use the "live" commands but stop them after a shortish timeout (i.e. no "dry-run" option/env-var required). The only issue with this is that we then need to provide real test data, which I have some ideas around how to automate, but would require detailed specification of the input file-types along the lines of what I was requesting in #2605 |
You know me, always hyper-focusing on other people being pedantic about words... 🙄
I'd thought about this a little when doing the python API. This is really a limitation with the |
Branching from question in #2665; giving its own thread as there's a few points to discuss that will diverge some distance from the code changes currently proposed there.
If I read correctly, the fundamental request is the capability to flag to a command that it should terminate at completion of command-line parsing, presumably for the purpose of verification of validity of a pipeline before commencing execution of the pipeline as a whole.
In MRtrix3-land, that would essentially equate to aborting after
app.Parser.parse_args()
in Python orMR::App::parse()
in C++.Important to recognize that this would not guarantee that the command is capable of executing; only that there was not an error that was detectable at the point of command-line parsing. For instance we do not check for the existence of input / output images, since the user could be doing something like this and just checking the filesystem for a file corresponding to that string won't work. There would be no check that things like text files expected to contain numerical matrix data actually contain such.
The proposal in WIP: Implement Pydra code-generators #2665 of "
--dry-run
" is potentially an issue in several ways:Regarding how one might engage such a functionality, there are multiple possibilities:
Awaiting any further elaboration / clarification from @tclose & will be curious to hear opinions from other @MRtrix3/mrtrix3-devs.
The text was updated successfully, but these errors were encountered: