-
Notifications
You must be signed in to change notification settings - Fork 282
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
Power options cleanup #82
base: master
Are you sure you want to change the base?
Conversation
show_power can no longer be bool or NoneType, but only str.
) | ||
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)' |
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.
It was never and/or limit. If limit
is included, then draw
is also always included.
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.
Do you mean passing limit
and draw, limit
gives the same output?
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.
Yes (limit,draw
as well, but I removed that in this PR)
) | ||
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)' |
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.
Do you mean passing limit
and draw, limit
gives the same output?
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 (
bool
orNoneType
orstr
) that differ from when it's running through other means (str
, set via the "choices" list).I noticed this when creating the
-e
parameter, 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,draw
option, 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,limit
is also exactly equivalent tolimit
, so I suggest removing one of them as well.