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

pseudocode for accepting a filtered pbp #507

Draft
wants to merge 1 commit into
base: tan/maintenance
Choose a base branch
from

Conversation

tanho63
Copy link
Member

@tanho63 tanho63 commented Jan 20, 2025

No description provided.

Copy link

@@ -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) %>%
Copy link
Member

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

Copy link
Member Author

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?

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

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

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member Author

@tanho63 tanho63 Jan 20, 2025

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

@tanho63 tanho63 force-pushed the tan/playstats-filtered-pbp branch from b888a3b to d47f15c Compare January 20, 2025 17:04
@tanho63 tanho63 changed the base branch from master to tan/maintenance January 20, 2025 17:05
@tanho63 tanho63 force-pushed the tan/playstats-filtered-pbp branch 3 times, most recently from a32b758 to 7f0c4b0 Compare January 20, 2025 18:01
@tanho63 tanho63 force-pushed the tan/playstats-filtered-pbp branch from 7f0c4b0 to 32a3585 Compare January 20, 2025 18:26
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