tests/testthat/fixtures/wnba_engine/README.md

WNBA Possession-Engine Test Fixtures

Purpose

Offline test inputs for wnba_possession_lineups() and wnba_rapm() (Task 1, feature branch feat/wnba-possessions-engine). Captured once; tests run without network access via readRDS().

Captured files

| File | Game | Source function | Shape | |---|---|---|---| | pbp_1022400001.rds | 1022400001 (NYL @ WAS, 2024) | wnba_pbp(on_court=TRUE, version="v3") | 405 rows × 73 cols | | box_1022400001.rds | 1022400001 | wnba_boxscoretraditionalv3() | list of 8 data frames | | pbp_1022400003.rds | 1022400003 (PHO @ LVA, 2024) | wnba_pbp(on_court=TRUE, version="v3") | 405 rows × 73 cols | | box_1022400003.rds | 1022400003 | wnba_boxscoretraditionalv3() | list of 8 data frames |

Capture details

Oracle targets (boxscore team totals)

| Game | Home team | Home pts | Away team | Away pts | |---|---|---|---|---| | 1022400001 | WAS (1611661322) | 80 | NYL (1611661313) | 85 | | 1022400003 | LVA (1611661319) | 89 | PHO (1611661317) | 80 |

These totals come from box_*$home_team_totals_traditional$points and $away_team_totals_traditional$points. The possession-engine's summed pts per team across all possession stints must equal these values.

Known limitation: Game 1022400001 on-court reconstruction

wnba_gamerotation(game_id="1022400001") returns an empty body (the stats.wnba.com rotation endpoint has no data for this game). As a result away_player1..5 / home_player1..5 are all NA in pbp_1022400001.rds. Game 1022400003 is fully populated (405/405 rows have on-court data). Use game 2 as the primary possession-engine smoke test; game 1 is retained for PBP schema and oracle-points testing.

Schema notes

wnba_pbp(version="v3") output (73 cols) is byte-identical in column names and meanings to hoopR::nba_pbp():

The engine port (Task 1) is a clean mirror — no column mapping needed.



Try the wehoop package in your browser

Any scripts or data that you put into this service are public.

wehoop documentation built on Aug. 25, 2026, 1:06 a.m.