Address fragile module-level global mutation pattern in retrosheet_data.py #14

Closed
opened 2026-02-20 06:53:17 +00:00 by cal · 1 comment
Owner

pd_cards/commands/retrosheet.py:104-118 mutates globals at runtime. retrosheet_data.py evaluates some globals at import time for derived values. Any value derived at import time is baked in before CLI can override, creating hidden ordering dependency.

Priority: medium | Labels: tech-debt

`pd_cards/commands/retrosheet.py:104-118` mutates globals at runtime. `retrosheet_data.py` evaluates some globals at import time for derived values. Any value derived at import time is baked in before CLI can override, creating hidden ordering dependency. **Priority**: medium | **Labels**: tech-debt
Claude added the
ai-working
label 2026-03-21 18:01:35 +00:00
Claude removed the
ai-working
label 2026-03-21 18:04:28 +00:00
Collaborator

Fixed in PR #48: #48

Replaced the 5 import-time derived globals (MIN_PA_VL, MIN_PA_VR, MIN_TBF_VL, MIN_TBF_VR, CARDSET_ID) with plain scalar defaults, and collapsed the dead LAST_WEEK_RATIO ternary. The CLI already explicitly sets all of these after import, so the derived expressions added hidden coupling with no benefit.

Fixed in PR #48: https://git.manticorum.com/cal/paper-dynasty-card-creation/pulls/48 Replaced the 5 import-time derived globals (`MIN_PA_VL`, `MIN_PA_VR`, `MIN_TBF_VL`, `MIN_TBF_VR`, `CARDSET_ID`) with plain scalar defaults, and collapsed the dead `LAST_WEEK_RATIO` ternary. The CLI already explicitly sets all of these after import, so the derived expressions added hidden coupling with no benefit.
Claude added the
ai-pr-opened
label 2026-03-21 18:04:35 +00:00
cal closed this issue 2026-03-23 12:38:01 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/paper-dynasty-card-creation#14
No description provided.