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

Improve handling of biddable and hidden fields #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ferraro1
Copy link
Collaborator

@ferraro1 ferraro1 commented Mar 6, 2019

Sets more intelligent values when these fields are left unspecified.
This in turn removes superfluous "both biddable and hidden" warnings.

Sets more intelligent values when these fields are left unspecified.
This in turn removes superfluous "both biddable and hidden" warnings.
@Felk
Copy link
Member

Felk commented Mar 17, 2019

Does this need a reviewer?

@ferraro1
Copy link
Collaborator Author

I think it's fine, but I made a PR in case someone wanted to eyeball it and comment

@Felk
Copy link
Member

Felk commented Mar 17, 2019

I left some comments, rest looks good

@ferraro1
Copy link
Collaborator Author

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

@Felk
Copy link
Member

Felk commented Mar 17, 2019

just #10
https://imgur.com/yJoUG4j

@ferraro1
Copy link
Collaborator Author

Here's what I see at that link: https://imgur.com/a/VwOSQFa
Don't you need to click submit review?

warn("Set is explicitly biddable, but also explicitly hidden, which doesn't make sense.")
else:
# fix default biddable value
if pokeset["biddable"] is None:
Copy link
Member

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?

Copy link
Member

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"]
Copy link
Member

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
Copy link
Member

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

@Felk
Copy link
Member

Felk commented Mar 17, 2019

oops, yea :)

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.

2 participants