Skip to content

Conversation

@MaxGhenis
Copy link
Contributor

@MaxGhenis MaxGhenis commented Jan 26, 2026

Summary

  • Add census block-level geographic assignment that replaces county-only methodology
  • Assign a census block to each household, then derive ALL geography from it for consistency
  • Look up comprehensive Census geographies from block GEOID:
    • County, tract, state (from GEOID structure)
    • CBSA/metro area (via NBER county crosswalk)
    • SLDU/SLDL (state legislative districts upper/lower)
    • Place/City FIPS (incorporated places and CDPs)
    • PUMA (Public Use Microdata Area)
    • VTD (Voting Tabulation District)

Data files

  • block_cd_distributions.csv.gz (25MB): P(block|CD) from 2020 Census populations + 119th Congress BEF
  • block_crosswalk.csv.gz (21MB): 8.1M blocks mapped to SLDU, SLDL, Place, VTD, PUMA from Census BAFs

Test plan

  • Tests for block assignment shape and determinism
  • Tests for geography lookup (county, tract, state from block GEOID)
  • Tests for CBSA lookup from county FIPS
  • Tests for SLDU/SLDL lookups
  • Tests for Place/City lookups
  • Tests for PUMA lookups
  • Tests for VTD lookups
  • Tests for integrated assignment returning all geography fields
  • Tests for County enum integration (backwards compatibility)

🤖 Generated with Claude Code

- Assign census blocks using P(block|CD) from Census population data
- Look up all geography from block GEOID for consistency:
  - County, tract, state (from GEOID structure)
  - CBSA/metro area (via NBER county crosswalk)
  - SLDU/SLDL (state legislative districts)
  - Place/City FIPS (via Census BAF)
  - PUMA (via tract crosswalk)
  - VTD (voting tabulation district)
- Add block_crosswalk.csv.gz (8.1M blocks) with BAF data
- Add make_block_crosswalk.py to generate crosswalk from Census BAFs
- Add comprehensive tests for all geography lookups

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@MaxGhenis MaxGhenis force-pushed the census-block-assignment branch from fb0b31f to f904a95 Compare January 26, 2026 00:13
@MaxGhenis
Copy link
Contributor Author

Closing to recreate from upstream branch

@MaxGhenis MaxGhenis closed this Jan 26, 2026
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