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

Power options cleanup #82

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ChaoticMind
Copy link
Contributor

@ChaoticMind ChaoticMind commented Apr 5, 2020

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 or NoneType or str) 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 to draw,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 to limit, so I suggest removing one of them as well.

)
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)'
Copy link
Contributor Author

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.

Copy link
Collaborator

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?

Copy link
Contributor Author

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)

README.md Show resolved Hide resolved
)
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)'
Copy link
Collaborator

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?

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