Skip to content

[codex] Backport congressional district outcome percentages to 0.x#267

Merged
MaxGhenis merged 1 commit into0.xfrom
codex/congressional-district-outcome-pct-0x
Apr 8, 2026
Merged

[codex] Backport congressional district outcome percentages to 0.x#267
MaxGhenis merged 1 commit into0.xfrom
codex/congressional-district-outcome-pct-0x

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

  • add winner, loser, and no-change percentages to legacy 0.x congressional_district_impact rows
  • compute those shares using people weights when available, with a household-weight fallback
  • add regression coverage for the new percentages and fallback behavior

Validation

  • python3 -m py_compile policyengine/outputs/macro/comparison/calculate_economy_comparison.py tests/country/test_us_congressional_districts.py tests/fixtures/simulation.py
  • black -l 79 --check policyengine/outputs/macro/comparison/calculate_economy_comparison.py tests/country/test_us_congressional_districts.py tests/fixtures/simulation.py
  • direct function-level smoke check for people-weighted and fallback percentages

Notes

  • local pytest tests/country/test_us_congressional_districts.py is blocked here by a pre-existing YAML parse error in the installed policyengine_us package before test collection starts, so GitHub CI is the authoritative test signal for this branch.

@MaxGhenis MaxGhenis marked this pull request as ready for review April 8, 2026 12:41
@MaxGhenis MaxGhenis merged commit 7a1ad76 into 0.x Apr 8, 2026
3 checks passed
@MaxGhenis MaxGhenis deleted the codex/congressional-district-outcome-pct-0x branch April 8, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant