-
Notifications
You must be signed in to change notification settings - Fork 4
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
Improve handling of biddable and hidden fields #10
base: master
Are you sure you want to change the base?
Improve handling of biddable and hidden fields #10
Conversation
Sets more intelligent values when these fields are left unspecified. This in turn removes superfluous "both biddable and hidden" warnings.
Does this need a reviewer? |
I think it's fine, but I made a PR in case someone wanted to eyeball it and comment |
I left some comments, rest looks good |
I don't see any comments for this PR though. What's the url that shows me your comments? I'm looking at https://github.com/TwitchPlaysPokemon/pokecat/pull/10/files |
Here's what I see at that link: https://imgur.com/a/VwOSQFa |
warn("Set is explicitly biddable, but also explicitly hidden, which doesn't make sense.") | ||
else: | ||
# fix default biddable value | ||
if pokeset["biddable"] is None: |
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.
if the above warnings emits, this codepath isn't executed, meaning biddable
and hidden
may still be None after population. Is this expected behaviour?
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.
also the fields aren't being validated either. The above should be an error, or cause sensible defaults I guess
if pokeset["hidden"] is True: | ||
pokeset["biddable"] = False | ||
else: | ||
pokeset["biddable"] = not pokeset["shiny"] |
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.
The paragraph on biddable
in pokesetspec.md
needs updating
if pokeset["hidden"] is None: | ||
if pokeset["biddable"]: | ||
# User set as biddable, OR user didn't specify and pokeset is not shiny | ||
pokeset["hidden"] = False |
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.
I suppose hidden
in pokesetspec.md
needs updating too
oops, yea :) |
Sets more intelligent values when these fields are left unspecified.
This in turn removes superfluous "both biddable and hidden" warnings.