relate: 52e4aa12 --FOLLOWS--> c7623317

This commit is contained in:
Cal Corum 2026-02-25 16:27:03 -06:00
parent 414f5214d0
commit 7160a9e749
3 changed files with 27 additions and 2 deletions

View File

@ -6,7 +6,13 @@ tags: [paper-dynasty, card-creation, card_layout, fullcard, cardcolumn, migratio
importance: 0.8
confidence: 0.8
created: "2026-02-25T22:26:22.293769+00:00"
updated: "2026-02-25T22:26:22.293769+00:00"
updated: "2026-02-25T22:27:03.620028+00:00"
relations:
- target: 52e4aa12-66ea-4c4b-9115-00099e4e4343
type: FOLLOWS
direction: incoming
strength: 0.8
edge_id: b663a957-e95e-49c1-b254-17567fc837f4
---
## Context\nOn branch feature/fullcard-migration, created /mnt/NV2/Development/paper-dynasty/card-creation/card_layout.py.\n\n## What Was Ported\nPorted PlayResult, PLAY_RESULTS, EXACT_CHANCES, get_chances(), CardResult, CardColumn, FullCard, FullBattingCard, FullPitchingCard from database/app/card_creation.py.\n\n## Key Adaptations\n- card_output() uses col_* key names (col_one_2d6, col_one_results, col_one_d20, col_two_2d6, col_two_results, col_two_d20, col_three_2d6, col_three_results, col_three_d20) to match planned DB column names — NOT the database version's one_2d6, two_2d6 etc.\n- get_chances() always returns Decimal(str(val)) to avoid float/Decimal comparison TypeError\n- FullBattingCard and FullPitchingCard do NOT embed a ratings model (no ratings= param) to avoid circular imports; only offense_col and alt_direction are passed

View File

@ -0,0 +1,13 @@
---
id: b663a957-e95e-49c1-b254-17567fc837f4
type: FOLLOWS
from_id: 52e4aa12-66ea-4c4b-9115-00099e4e4343
from_title: "Fix: Float/Decimal type mismatch in card builders (card-creation repo)"
to_id: c7623317-ea0a-4b8a-9375-65fc3aac5303
to_title: "FullCard Migration: card_layout.py ported to card-creation repo"
strength: 0.8
created: "2026-02-25T22:27:03.620028+00:00"
updated: "2026-02-25T22:27:03.620028+00:00"
---
Float/Decimal fix was required during the card_layout.py porting work

View File

@ -6,7 +6,13 @@ tags: [paper-dynasty, card-creation, card_builder, decimal, float, typeerror, ty
importance: 0.8
confidence: 0.8
created: "2026-02-25T22:26:37.646158+00:00"
updated: "2026-02-25T22:26:37.646158+00:00"
updated: "2026-02-25T22:27:03.620028+00:00"
relations:
- target: c7623317-ea0a-4b8a-9375-65fc3aac5303
type: FOLLOWS
direction: outgoing
strength: 0.8
edge_id: b663a957-e95e-49c1-b254-17567fc837f4
---
## Problem\nWhen porting card builders from database (which uses Decimal throughout) to card-creation (which uses float in BattingCardRatingsModel/PitchingCardRatingsModel), all res_chances arithmetic fails. CardColumn.add_result() and FullCard.card_fill() return Decimal tuples while model fields are float, causing TypeError.\n\n## Two Required Fixes\n1. **assign_bchances()/assign_pchances()**: wrap all return values as (float(r_data[0]), float(r_data[1])) before returning\n2. **card.card_fill() call in filler loop**: r_raw = card.card_fill(play_res); r_val = (float(r_raw[0]), float(r_raw[1]))\n\n## What NOT To Do\nDo NOT try to convert res_chances to Decimal at initialization — that would require changing 50+ subtraction lines.