Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# nflreadpy devel

- update load_participation() season assertions to use improved week-level logic.

---
# nflreadpy v0.1.5
Release date: 2025-11-19

Expand Down
12 changes: 9 additions & 3 deletions src/nflreadpy/load_participation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import polars as pl

from .downloader import get_downloader
from .utils_date import get_current_season
from .utils_date import get_current_season, get_current_week


def load_participation(seasons: int | list[int] | bool | None = None) -> pl.DataFrame:
Expand All @@ -27,8 +27,14 @@ def load_participation(seasons: int | list[int] | bool | None = None) -> pl.Data
Data Dictionary:
<https://nflreadr.nflverse.com/articles/dictionary_participation.html>
"""
# participation only available on a historical basis from FTN
max_season = get_current_season(roster=True) - 1
# we expect to have participation data available after the final week of the
# season from FTN
current_week = get_current_week(use_date=False)
if current_week == 22:
max_season = get_current_season()
else:
max_season = get_current_season() - 1

if seasons is None:
seasons = [max_season]
elif seasons is True:
Expand Down