Skip to content

Preserve Forbes state geography in local calibration#826

Open
MaxGhenis wants to merge 2 commits intomainfrom
codex/forbes-location-preservation
Open

Preserve Forbes state geography in local calibration#826
MaxGhenis wants to merge 2 commits intomainfrom
codex/forbes-location-preservation

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

@MaxGhenis MaxGhenis commented Apr 25, 2026

Summary

  • carry Forbes residence state as a sidecar forbes_state_fips marker on synthetic PUF top-tail rows
  • preserve those known states when local calibration assigns block/CD geography
  • preserve Forbes source metadata (forbes_name, alias, snapshot date, rank, marital status, children, replicate/unit ids) on the PUF-side household and tax-unit records
  • map Forbes age into the filer/head person age for synthetic Forbes households
  • add tests for Forbes state markers, source metadata, UTF-8 names, fixed-state geography assignment, and local override extraction

Tests

  • uv run ruff check policyengine_us_data/datasets/puf/forbes_backbone.py policyengine_us_data/datasets/puf/disaggregate_puf.py policyengine_us_data/datasets/puf/puf.py policyengine_us_data/calibration/clone_and_assign.py policyengine_us_data/calibration/unified_calibration.py tests/unit/datasets/test_disaggregate_puf.py tests/unit/calibration/test_clone_and_assign.py tests/unit/calibration/test_unified_calibration.py
  • uv run ruff format --check policyengine_us_data/datasets/puf/forbes_backbone.py policyengine_us_data/datasets/puf/disaggregate_puf.py policyengine_us_data/datasets/puf/puf.py policyengine_us_data/calibration/clone_and_assign.py policyengine_us_data/calibration/unified_calibration.py tests/unit/datasets/test_disaggregate_puf.py tests/unit/calibration/test_clone_and_assign.py tests/unit/calibration/test_unified_calibration.py
  • PYTHONDONTWRITEBYTECODE=1 uv run pytest tests/unit/datasets/test_disaggregate_puf.py tests/unit/calibration/test_clone_and_assign.py tests/unit/calibration/test_unified_calibration.py -q -p no:cacheprovider (112 passed)

Note: full uv run ruff check . still reports pre-existing lint issues in notebooks/scripts outside this patch.

@MaxGhenis MaxGhenis force-pushed the codex/forbes-location-preservation branch from 7613dc3 to 4cb3520 Compare April 25, 2026 23:18
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