Open
Conversation
show_power can no longer be bool or NoneType, but only str.
ChaoticMind
commented
Apr 5, 2020
| parser.add_argument( | ||
| '-P', '--show-power', nargs='?', const='draw,limit', | ||
| choices=['', 'draw', 'limit', 'draw,limit', 'limit,draw'], | ||
| help='Show GPU power usage or draw (and/or limit)' |
Contributor
Author
There was a problem hiding this comment.
It was never and/or limit. If limit is included, then draw is also always included.
Collaborator
There was a problem hiding this comment.
Do you mean passing limit and draw, limit gives the same output?
Contributor
Author
There was a problem hiding this comment.
Yes (limit,draw as well, but I removed that in this PR)
Stonesjtu
reviewed
Apr 5, 2020
| parser.add_argument( | ||
| '-P', '--show-power', nargs='?', const='draw,limit', | ||
| choices=['', 'draw', 'limit', 'draw,limit', 'limit,draw'], | ||
| help='Show GPU power usage or draw (and/or limit)' |
Collaborator
There was a problem hiding this comment.
Do you mean passing limit and draw, limit gives the same output?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I ran through some inconsistencies when preparing my PR a couple weeks ago, thought I'd upstream them.
Basically, when run via the tests, show_power has types (
boolorNoneTypeorstr) that differ from when it's running through other means (str, set via the "choices" list).I noticed this when creating the
-eparameter, and the type consistency was a source of confusion. I speculate that the original cause is simply a bad copy/paste from other parameters that actually are booleans.This PR also removes the
limit,drawoption, as it's exactly equivalent todraw,limit. One may think it behaves differently (switches the order or something, which it doesn't). Best to have a canonical option instead, imo.Technically,
draw,limitis also exactly equivalent tolimit, so I suggest removing one of them as well.