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
DM-26415: remove chained commands from pipetask2 and DM-26388: pipetask2 --butler-config should accept a repository URI #67
Conversation
Vestigial. Should have been removed before previous merge to master.
Recommendation from prevous review, simplifies passing of bucket-of-arguments.
Also removes "option forwarding" support, which was for chaned commands. Removes test_cliCmd.py because the only substantive test it did was for forwarding options.
"pipeline. This must be the fully qualified class name.") | ||
|
||
|
||
class OptionGroup(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you want to add base class inside parentheses?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but I guess I can remove the parens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK, one minor concern about catch-all **kwargs
, would be nice to have safer way to do that.
return f | ||
|
||
|
||
class pipeline_build_options(OptionGroup): # noqa: N801 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Short one-line docstring could be useful for these classes.
ctrlMpExecOpts.skip_existing_option(), | ||
ctrlMpExecOpts.save_qgraph_option(), | ||
ctrlMpExecOpts.save_single_quanta_option(), | ||
ctrlMpExecOpts.qgraph_dot_option()] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick - there is a mixture of wrapping/indentation styles in different classes like
self.decorators = [decorator1,
decorator2]
vs.
self.decorators = [
decorator1,
decorator2
]
I personally prefer latter style, feels more readable as it lets you pack longer lines without more wrapping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, latter is nice. 👍
kwargs : `dict` [`str`, `str`] | ||
Ignored; click commands may accept options for more than one script | ||
function and pass all the option kwargs to each of the script functions | ||
which ingore these unused kwargs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this is potentially problematic, if for example client misspells option/keyword name, you won't catch it here. Could we do something safer here (and other places like this)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andy-slac I think there is not a good reason for the explicit kwargs to have default values. What if I removed them? That way if any of them are misspelled, and therefore missing, there will be an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Click generates default value for all the options, the command function gets called with a kwarg for each of the @option
s it is decorated with.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having default values here and in click indeed bothers me too. If we say that all arguments are required than indeed we can drop defaults here and that should reduce the probability for spelling errors.
Make 'qgraph' call 'build', and take its subcommands. Make 'run' call 'build' and 'qgraph', and take their subcommands. Groups options functionally so that commands that accept options for a function, like managing a butler, can share the same set of options.
it needs to accept any path or URI, per DM-26388
c97fef8
to
431b9a6
Compare
No description provided.