Skip to content

Add district breakdowns to state-level simulations #216

@anth-volk

Description

@anth-volk

Summary

Add congressional district-level breakdowns to US state-level simulation results, mirroring the existing UK parliamentary constituency and local authority breakdown functionality.

Background

The UK version of PolicyEngine already provides geographic breakdowns for:

  • Parliamentary constituencies (650 areas)
  • Local authorities (360 areas)

These breakdowns show average_household_income_change and relative_household_income_change for each geographic area within a simulation.

Proposed Changes

For US state-level simulations, add a congressional_district_impact field to EconomyComparison that breaks down results by congressional district within the state.

Output Format

{
  "congressional_district_impact": {
    "districts": [
      {
        "district": "GA-05",
        "average_household_income_change": 312.45,
        "relative_household_income_change": 0.0187
      },
      {
        "district": "GA-06",
        "average_household_income_change": 287.12,
        "relative_household_income_change": 0.0165
      }
    ]
  }
}

Implementation Approach

  1. Extract congressional_district_geoid from state-level datasets (already present in state HDF5 files)
  2. Group households by district geoid
  3. Calculate weighted income changes per district using the same formulas as UK constituencies
  4. Return sorted list of district impacts

Benefits

  • Enables district-level policy analysis from 51 state simulations instead of 435 district simulations
  • Reduces compute time from ~8 hours (sequential) to ~5 minutes (parallel states)
  • Consistent with existing UK geographic breakdown patterns

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions