store: Fix: PitchingCardRatingsModel xcheck defaults must be zeroed in new_ratings

This commit is contained in:
Cal Corum 2026-02-25 16:26:54 -06:00
parent 3bc4e6c032
commit 2cc87348a9

View File

@ -0,0 +1,12 @@
---
id: 2d704690-8790-4f67-bf0d-1bd1e50460a9
type: fix
title: "Fix: PitchingCardRatingsModel xcheck defaults must be zeroed in new_ratings"
tags: [paper-dynasty, card-creation, pitchers, card_builder, xcheck, pitchingcardratingsmodel, defaults, bug]
importance: 0.7
confidence: 0.8
created: "2026-02-25T22:26:54.035955+00:00"
updated: "2026-02-25T22:26:54.035955+00:00"
---
## Problem\nPitchingCardRatingsModel has non-zero default values for xcheck fields:\n- xcheck_p=1.0, xcheck_c=3.0, xcheck_1b=2.0, xcheck_2b=6.0, xcheck_3b=3.0\n- xcheck_ss=7.0, xcheck_lf=2.0, xcheck_cf=3.0, xcheck_rf=2.0\n\nWhen creating the tracking new_ratings object in build_pitcher_full_cards(), if these are not explicitly zeroed, the accumulated xcheck values will be wrong (seeded with defaults instead of starting from 0).\n\n## Fix: Always Initialize Explicitly\n```python\nnew_ratings = PitchingCardRatingsModel(\n pitchingcard_id=data.pitchingcard_id,\n pit_hand=data.pit_hand, vs_hand=vs_hand,\n hard_rate=data.hard_rate, med_rate=data.med_rate, soft_rate=data.soft_rate,\n xcheck_p=0.0, xcheck_c=0.0, xcheck_1b=0.0, xcheck_2b=0.0,\n xcheck_3b=0.0, xcheck_ss=0.0, xcheck_lf=0.0, xcheck_cf=0.0, xcheck_rf=0.0\n)\n```\n\n## Location\npitchers/card_builder.py → build_pitcher_full_cards()