From 7160a9e7491ec33e74c73e968c4dc20b68c07ea2 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Wed, 25 Feb 2026 16:27:03 -0600 Subject: [PATCH] relate: 52e4aa12 --FOLLOWS--> c7623317 --- ...d-layoutpy-ported-to-card-creation-rep-c76233.md | 8 +++++++- ...OLLOWS--fullcard-migration-card-layout-b663a9.md | 13 +++++++++++++ ...mismatch-in-card-builders-card-creatio-52e4aa.md | 8 +++++++- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 graph/edges/fix-floatdecimal-type-mismatch--FOLLOWS--fullcard-migration-card-layout-b663a9.md diff --git a/graph/decisions/fullcard-migration-card-layoutpy-ported-to-card-creation-rep-c76233.md b/graph/decisions/fullcard-migration-card-layoutpy-ported-to-card-creation-rep-c76233.md index 320430f9376..3e6fa1ce8af 100644 --- a/graph/decisions/fullcard-migration-card-layoutpy-ported-to-card-creation-rep-c76233.md +++ b/graph/decisions/fullcard-migration-card-layoutpy-ported-to-card-creation-rep-c76233.md @@ -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 diff --git a/graph/edges/fix-floatdecimal-type-mismatch--FOLLOWS--fullcard-migration-card-layout-b663a9.md b/graph/edges/fix-floatdecimal-type-mismatch--FOLLOWS--fullcard-migration-card-layout-b663a9.md new file mode 100644 index 00000000000..e6907d22896 --- /dev/null +++ b/graph/edges/fix-floatdecimal-type-mismatch--FOLLOWS--fullcard-migration-card-layout-b663a9.md @@ -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 diff --git a/graph/fixes/fix-floatdecimal-type-mismatch-in-card-builders-card-creatio-52e4aa.md b/graph/fixes/fix-floatdecimal-type-mismatch-in-card-builders-card-creatio-52e4aa.md index 783be314c8b..bd69f1431b5 100644 --- a/graph/fixes/fix-floatdecimal-type-mismatch-in-card-builders-card-creatio-52e4aa.md +++ b/graph/fixes/fix-floatdecimal-type-mismatch-in-card-builders-card-creatio-52e4aa.md @@ -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.