[codex] Add congressional district outcome percentages#266
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
winner_percentage,loser_percentage, andno_change_percentagefields to the congressional district impact outputhousehold_count_people * household_weight, with a fallback when the people count column is absentWhy
The congressional district summary payload exposed average and relative income change, but not winner/loser shares. The frontend district map needs those shares in the state summary payload instead of computing them through hundreds of district-level requests.
Impact
US nationwide economy comparisons can expose district-level winner/loser/no-change shares directly in
congressional_district_impact, which allows downstream clients to render those map modes from the main payload.Validation
uv run pytest --noconftest tests/test_congressional_district_impact.pywas attempted, but the local build environment fails while compilingpydantic-corefor Python 3.14 (Error: not inside a tmux sessionduring Rust linking)Notes
policyengine-api-v2route change is needed for this shape; the simulation service already returns thepolicyengineresult blob directly.