fix: remove import-time derived globals in retrosheet_data.py (#14)

Closes #14

Five globals (MIN_PA_VL, MIN_PA_VR, MIN_TBF_VL, MIN_TBF_VR, CARDSET_ID)
were derived from PLAYER_DESCRIPTION at module load time, creating a
hidden ordering dependency: any value baked in before the CLI overrides
PLAYER_DESCRIPTION would be silently wrong if a caller relied on the
derived relationship. The CLI explicitly sets all of them anyway, so
replacing with scalar defaults makes the module self-contained and safe.

Also collapses LAST_WEEK_RATIO dead ternary (both branches were 0.0).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-03-21 13:04:09 -05:00
parent fd142c27d2
commit d43927258a

View File

@ -53,13 +53,11 @@ PROMO_INCLUSION_RETRO_IDS = [
# 'haraa001', # Aaron Harang (SP)
# 'hofft001', # Trevor Hoffman (RP)
]
MIN_PA_VL = 20 if "live" in PLAYER_DESCRIPTION.lower() else 1 # 1 for PotM
MIN_PA_VR = 40 if "live" in PLAYER_DESCRIPTION.lower() else 1 # 1 for PotM
MIN_TBF_VL = MIN_PA_VL
MIN_TBF_VR = MIN_PA_VR
CARDSET_ID = (
27 if "live" in PLAYER_DESCRIPTION.lower() else 28
) # 27: 2005 Live, 28: 2005 Promos
MIN_PA_VL = 20 # 1 for PotM
MIN_PA_VR = 40 # 1 for PotM
MIN_TBF_VL = 20
MIN_TBF_VR = 40
CARDSET_ID = 27 # 27: 2005 Live, 28: 2005 Promos
# Per-Update Parameters
SEASON_PCT = 81 / 162 # Through end of July (~half season)