-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Description
Summary
Add support for filtering US simulations by Census place (city/town) to enable city-level impact analysis.
Background
Currently, PolicyEngine supports national, state, and congressional district level impact analysis for the US. This feature adds support for Census places (cities, towns, CDPs) with population over 100,000, enabling more granular local analysis.
Technical Details
Region String Format
- Format:
place/{STATE_ABBREV}-{PLACE_FIPS} - Example:
place/NJ-57000for Paterson, NJ
Implementation
- Add
"place"toUSRegionTypeandUS_REGION_PREFIXESindatasets.py - Add
parse_us_place_region()helper function to extract state code and place FIPS - Add place handling in
_get_default_us_dataset()to load the parent state's dataset - Add
_filter_us_simulation_by_place()method insimulation.pyto filter households byplace_fips
How It Works
- When a place region is selected, the system loads the parent state's dataset
- Households are filtered by matching the
place_fipsvariable in the dataset - The 100k population cutoff ensures sufficient sample sizes (500+ unweighted households)
Related
- Companion PR needed in policyengine-app-v2 for the frontend UI
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels