-
Notifications
You must be signed in to change notification settings - Fork 53
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
pseudocode for accepting a filtered pbp #507
base: tan/maintenance
Are you sure you want to change the base?
Conversation
@@ -105,9 +109,10 @@ calculate_stats <- function(seasons = nflreadr::most_recent_season(), | |||
# we need those to identify things like fumbles depending on playtype or | |||
# first downs depending on playtype | |||
playstats <- load_playstats(seasons = seasons) %>% |
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.
Need to pull seasons from custom pbp. So the seasons arg is actually ignored in that case
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.
Yeah, can probably warn/check somehow?
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.
Yeah I think I'd print a message when custom_pbp is TRUE. But not every time. One of those "once every 8 hours" messages
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.
Here is an example how to do that with cli https://github.com/nflverse/nflseedR/blob/a8f90520c45ecf5e6d2e8abd61a641613e622761/R/simulations.R#L186-L193
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.
yeah that's fine. we'd probably want to validate the seasons are in pbp and probably validate that playstats is nonzero rows as well
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.
actually as long as pbp is nonzero rows playstats should be nonzero rows
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.
Yeah I never really thought about validation of the seasons arg because load_pbp checks for valid seasons.
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'd even skip the message about ignoring pbp and just check the custom pbp for the seasons, if any are missing it should warn. then we can call it a day on the season arg since it does what the user expects it to do
b888a3b
to
d47f15c
Compare
c525c8d
to
5da2401
Compare
a32b758
to
7f0c4b0
Compare
7f0c4b0
to
32a3585
Compare
No description provided.