Repository navigation
Conversation
The 2026 season opens Wednesday Sept 9 (NE @ SEA) rather than the usual Thursday, so get_current_season() and get_current_week() would both have been a day late rolling over. get_current_week(use_date=True) was also using a different definition of the season start than get_current_season(): the first Thursday in September rather than the Thursday following Labor Day. Those coincide some years but not in 2026 (Sept 2 vs Sept 9), which would have reported opening day as week 2 and left every later week off by one. Both now share a single _season_start() helper. The boundary sits on the Wednesday for every season, not just 2026. It lands on a no-game day whether the season opens Wednesday or Thursday, so week numbering stays correct either way - replaying the 2015-2025 schedules through it reproduces the right week for all but one of 2895 regular season games (2020-12-02, a genuinely rescheduled Wednesday game). Adds tests/test_utils_date.py covering the rollover boundary, week numbering, and the March 15 roster flip without touching the network.
Member
|
Duplicate of #61 |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
2026 opens on Wednesday Sept 9 (NE @ SEA) instead of the usual Thursday, so
get_current_season()andget_current_week()would both have rolled over a day late.The boundary is on the Wednesday for every season, not just 2026. It lands on a no-game day whether the opener is Wednesday or Thursday, so week numbers work out either way — I ran the 2015-2025 schedules through it and got the right week for all but one of 2895 regular season games (2020-12-02, which really was a rescheduled Wednesday game).
Meant to address #60
Sanity checks against real schedule data: