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-35917: Migrate config setting docs from pipe_base and update code to match expectations #199

Merged
merged 18 commits into from Aug 26, 2022

Conversation

timj
Copy link
Member

@timj timj commented Aug 20, 2022

Whilst migrating some config docs from pipe_base I realized that the --show option was not working right. I ended up trying to fix it.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

show = ShowInfo(kwargs.pop("show", []))
pipeline = script.build(**kwargs, show=show)
if show.handled and not show.unhandled:
# The show option was given and all options were processed.
Copy link
Member Author

Choose a reason for hiding this comment

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

I wonder if we should print this to the user so they aren't confused.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, if the output from e.g. dump-config is redirected to a file, it may also confuse something.

Copy link
Member Author

Choose a reason for hiding this comment

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

We can print to stderr?

Copy link
Collaborator

Choose a reason for hiding this comment

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

stderr is probably better than stdout, though we should probably ask users about what they want. I myself almost never use pipetask, so my opinion probably should not count.

@timj timj force-pushed the tickets/DM-35917 branch 2 times, most recently from 7619b97 to d790409 Compare August 20, 2022 00:31
@codecov
Copy link

codecov bot commented Aug 20, 2022

Codecov Report

Merging #199 (bbebb87) into main (3ebffe2) will increase coverage by 0.93%.
The diff coverage is 77.73%.

❗ Current head bbebb87 differs from pull request most recent head 10d3583. Consider uploading reports for the commit 10d3583 to get more accurate results

@@            Coverage Diff             @@
##             main     #199      +/-   ##
==========================================
+ Coverage   82.42%   83.35%   +0.93%     
==========================================
  Files          47       48       +1     
  Lines        3755     3846      +91     
  Branches      676      690      +14     
==========================================
+ Hits         3095     3206     +111     
+ Misses        481      470      -11     
+ Partials      179      170       -9     
Impacted Files Coverage Δ
python/lsst/ctrl/mpexec/cli/script/qgraph.py 42.85% <0.00%> (+2.85%) ⬆️
python/lsst/ctrl/mpexec/executionGraphFixup.py 85.71% <ø> (ø)
python/lsst/ctrl/mpexec/cli/cmd/commands.py 71.11% <24.00%> (-13.18%) ⬇️
python/lsst/ctrl/mpexec/cli/utils.py 90.00% <75.00%> (+0.20%) ⬆️
python/lsst/ctrl/mpexec/showInfo.py 78.16% <78.16%> (ø)
python/lsst/ctrl/mpexec/cli/script/build.py 81.81% <100.00%> (-1.52%) ⬇️
python/lsst/ctrl/mpexec/cmdLineFwk.py 67.62% <100.00%> (+5.68%) ⬆️
tests/test_cliScript.py 95.83% <100.00%> (+0.05%) ⬆️
tests/test_cmdLineFwk.py 97.92% <100.00%> (+0.19%) ⬆️
python/lsst/ctrl/mpexec/util.py 40.00% <0.00%> (+1.81%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@timj timj force-pushed the tickets/DM-35917 branch 2 times, most recently from c635871 to 8100e02 Compare August 22, 2022 21:36
@timj timj mentioned this pull request Aug 22, 2022
2 tasks
@timj timj changed the title DM-35917: Clean up --show option and migrate some docs from pipe_base DM-35917: Migrate config setting docs from pipe_base and update code to match expectations Aug 23, 2022
1. Keep track of which options have been used.
2. No longer run the pipeline show options multiple times
   for pipetask qgraph.
3. No longer warn about options not being used when they
   are about to be used.
4. If --show is used, no longer continue on unless there are
   remaining --show options to process.

The latter means that using `pipetask qgraph` with only pipeline
show options exits without building the graph, and any use of
--show leads to `pipetask run` not running anything.
This matches what the click option callback is doing itself
and so ensures consitency in option handling.
@timj timj force-pushed the tickets/DM-35917 branch 3 times, most recently from 1f8a19c to abd210a Compare August 23, 2022 16:31
@timj timj marked this pull request as ready for review August 23, 2022 19:29
This is easier to test and it is odd having a class be able to exit.
This makes it easier to test the output.
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 great, few minor comments.

doc/lsst.ctrl.mpexec/CHANGES.rst Outdated Show resolved Hide resolved
doc/lsst.ctrl.mpexec/configuring-pipetask-tasks.rst Outdated Show resolved Hide resolved
doc/lsst.ctrl.mpexec/configuring-pipetask-tasks.rst Outdated Show resolved Hide resolved
doc/lsst.ctrl.mpexec/configuring-pipetask-tasks.rst Outdated Show resolved Hide resolved
doc/lsst.ctrl.mpexec/configuring-pipetask-tasks.rst Outdated Show resolved Hide resolved
doc/lsst.ctrl.mpexec/configuring-pipetask-tasks.rst Outdated Show resolved Hide resolved
python/lsst/ctrl/mpexec/showInfo.py Outdated Show resolved Hide resolved
python/lsst/ctrl/mpexec/cli/script/qgraph.py Show resolved Hide resolved
There is a non-zero chance that people might want to specify
a command-line config option that includes a comma and it's
safer to require people to use multiple --config options.
This makes it clear why the command finished without doing anything.
@timj timj merged commit c2e4510 into main Aug 26, 2022
@timj timj deleted the tickets/DM-35917 branch August 26, 2022 15:55
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