Skip to content
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

Merged
merged 6 commits into from Aug 25, 2020

Conversation

n8pease
Copy link
Contributor

@n8pease n8pease commented Aug 22, 2020

No description provided.

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():
Copy link
Collaborator

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?

Copy link
Contributor Author

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator

@andy-slac andy-slac left a 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
Copy link
Collaborator

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()]
Copy link
Collaborator

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.

Copy link
Contributor Author

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.
Copy link
Collaborator

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)?

Copy link
Contributor Author

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.

Copy link
Contributor Author

@n8pease n8pease Aug 24, 2020

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 @options it is decorated with.)

Copy link
Collaborator

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
@n8pease n8pease merged commit 37abb6e into master Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants