Fix hold rating formula and format codebase #23

Merged
cal merged 3 commits from fix/hold-rating-and-formatting into main 2026-03-10 15:48:00 +00:00
Owner

Summary

  • Fix pitcher hold rating: Changed pickoffs from an override (min(pick_cap, hold_num)) to a bonus modifier. Previously 31% of pitchers got -3 hold because pickoffs completely overrode bad CS%. Now pickoffs improve the CS%-based rating by 1-3 points instead. Pitchers with no CS data default to +2 (improvable to -1 with pickoff bonus) instead of +9.
  • Run black and ruff across the entire codebase (109 files)
  • Remove unused defenders/creation.py stub (1-line file with invalid syntax, not imported anywhere)

Test plan

  • Verified new hold distribution: -3 drops from 31.2% → 10.7%
  • Verified pitchers with 0% CS no longer get elite hold ratings from pickoffs alone
  • Verified NaN CS pitchers start at +2 with pickoff bonus capped at -1
  • Run retrosheet pipeline against 2005 data to confirm end-to-end

🤖 Generated with Claude Code

## Summary - **Fix pitcher hold rating**: Changed pickoffs from an override (`min(pick_cap, hold_num)`) to a bonus modifier. Previously 31% of pitchers got -3 hold because pickoffs completely overrode bad CS%. Now pickoffs improve the CS%-based rating by 1-3 points instead. Pitchers with no CS data default to +2 (improvable to -1 with pickoff bonus) instead of +9. - **Run black and ruff** across the entire codebase (109 files) - **Remove unused `defenders/creation.py`** stub (1-line file with invalid syntax, not imported anywhere) ## Test plan - [x] Verified new hold distribution: -3 drops from 31.2% → 10.7% - [x] Verified pitchers with 0% CS no longer get elite hold ratings from pickoffs alone - [x] Verified NaN CS pitchers start at +2 with pickoff bonus capped at -1 - [ ] Run retrosheet pipeline against 2005 data to confirm end-to-end 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cal added 3 commits 2026-03-08 19:25:06 +00:00
Pickoffs were using min(pick_cap, hold_num) which let high pickoff counts
completely override bad CS%, giving 31% of pitchers a -3 hold rating.
Now pickoffs act as a 1-3 point bonus on top of the CS%-based rating.
Pitchers with no CS data default to +2 (capped at -1 with pickoff bonus)
instead of the old +9.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Standardize formatting with black and apply ruff auto-fixes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Single-line file with invalid syntax, not imported anywhere.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cal merged commit 336014b689 into main 2026-03-10 15:48:00 +00:00
cal deleted branch fix/hold-rating-and-formatting 2026-03-10 15:48:00 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 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#23
No description provided.