paper-dynasty-database/tests
Cal Corum 1b4eab9d99 refactor: replace incremental delta upserts with full recalculation in season stats
The previous approach accumulated per-game deltas into season stats rows,
which was fragile — partial processing corrupted stats, upsert bugs
compounded, and there was no self-healing mechanism.

Now update_season_stats() recomputes full season totals from all StratPlay
rows for each affected player whenever a game is processed. The result
replaces whatever was stored, eliminating double-counting and enabling
self-healing via force=True.

Also fixes:
- evolution_evaluator.py: broken PlayerSeasonStats import → queries
  BattingSeasonStats or PitchingSeasonStats based on card_type
- evolution_evaluator.py: r.k → r.strikeouts
- test_evolution_models.py, test_postgame_evolution.py: PlayerSeasonStats
  → BattingSeasonStats (model never existed)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 10:17:13 -05:00
..
__init__.py feat: evolution track seed data and tests (WP-03) (#68) 2026-03-12 17:35:12 -05:00
conftest.py fix: add missing pg_conn fixture to conftest.py 2026-03-18 15:33:02 -05:00
test_evolution_evaluator.py refactor: replace incremental delta upserts with full recalculation in season stats 2026-03-19 10:17:13 -05:00
test_evolution_init.py feat(WP-10): pack opening hook — evolution_card_state initialization 2026-03-18 13:41:05 -05:00
test_evolution_models.py refactor: replace incremental delta upserts with full recalculation in season stats 2026-03-19 10:17:13 -05:00
test_evolution_seed.py test: add Phase 1a test suite (25 tests) 2026-03-17 19:33:49 -05:00
test_evolution_state_api.py feat(WP-07): card state API endpoints — closes #72 2026-03-18 15:33:02 -05:00
test_evolution_track_api.py feat: Track Catalog API endpoints (WP-06) (#71) 2026-03-12 20:40:38 -05:00
test_formula_engine.py fix: align tier_from_value with DB model field names (t1_threshold) 2026-03-18 15:07:07 -05:00
test_postgame_evolution.py refactor: replace incremental delta upserts with full recalculation in season stats 2026-03-19 10:17:13 -05:00
test_season_stats_model.py refactor: deduplicate pitcher formula and test constants 2026-03-17 09:49:33 -05:00
test_season_stats_update.py refactor: replace incremental delta upserts with full recalculation in season stats 2026-03-19 10:17:13 -05:00