fix: correct get_of() opposite-field direction for switch hitters #40
No reviewers
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-card-creation#40
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ai/paper-dynasty-card-creation#5"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
get_of()(creation_helpers.py:689-693) where bothpull_side=Trueandpull_side=Falsereturned the same outfield direction for switch hitterslf, oppo=rf(wasrf/rf)rf, oppo=lf(waslf/lf)Closes #5
Test plan
creation_helpers.py:689-693to confirm both branches now differAI Code Review
Files Reviewed
creation_helpers.py(modified)Findings
Correctness
The core fix at lines 688–694 is correct. Switch hitters bat opposite-hand against pitchers:
pull_side=True→"lf",pull_side=False→"rf"✓pull_side=True→"rf",pull_side=False→"lf"✓This now matches the established pattern for
"R"and"L"batter branches above it. The copy-paste bug (both branches returning the same value, making thepull_sideparameter meaningless for switch hitters) is cleanly resolved.The remainder of the diff is cosmetic f-string reformatting (
f'{"..."}→f"{'...'}"with swapped quote styles). Both forms are valid Python and produce identical output — no behavioral change.Security
No issues found.
Style & Conventions
F-string style changes are consistent with the rest of the file and produce cleaner-reading code. No convention violations.
Suggestions
get_of("S", "L", pull_side=True)→"lf"andget_of("S", "L", pull_side=False)→"rf"(and the RHP variants) would prevent regression. The function is pure and trivial to test. Not a blocker.Verdict: COMMENT (LGTM)
Correct fix for an obvious copy-paste bug. The switch-hitter direction logic now matches the R/L batter pattern as expected. Ready to merge.
Automated review by Claude PR Reviewer
Approved — safe bug fix per PO triage.