From d43927258aa4766608639f2697d4a9c8c73366f8 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Sat, 21 Mar 2026 13:04:09 -0500 Subject: [PATCH] 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 --- retrosheet_data.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/retrosheet_data.py b/retrosheet_data.py index 8b18204..6188d95 100644 --- a/retrosheet_data.py +++ b/retrosheet_data.py @@ -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) -- 2.25.1