Skip to content

Align SPM thresholds and clone priors#917

Merged
MaxGhenis merged 2 commits intomainfrom
codex/revive-702-spm-threshold-targets
May 7, 2026
Merged

Align SPM thresholds and clone priors#917
MaxGhenis merged 2 commits intomainfrom
codex/revive-702-spm-threshold-targets

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Revives the safe parts of #702 after rebasing on latest main.

Changes:

  • replace spm-calculator base thresholds with published Census SPM reference thresholds through 2024, with CPI-U fallback for future years
  • make congressional-district geoadj tenure-specific and pass tenure-aware geoadj through extended CPS, local-area, and chunked clone SPM threshold recalculation
  • preserve positive household weights exactly while keeping zero-weight clone priors at tiny epsilon before sparse reweighting

Intentionally left out:

Tests:

  • .venv/bin/python -m pytest -q tests/unit/calibration/test_spm_thresholds.py tests/unit/test_extended_cps.py tests/unit/test_enhanced_cps_clone_diagnostics.py tests/unit/calibration/test_entity_clone.py tests/integration/test_chunked_matrix_builder.py tests/unit/test_etl_national_targets.py tests/unit/calibration/test_loss_targets.py tests/unit/test_small_enhanced_cps.py
  • .venv/bin/ruff check policyengine_us_data/utils/spm.py policyengine_us_data/calibration/calibration_utils.py policyengine_us_data/calibration/entity_clone.py policyengine_us_data/calibration/publish_local_area.py policyengine_us_data/datasets/cps/enhanced_cps.py policyengine_us_data/datasets/cps/extended_cps.py tests/unit/calibration/test_spm_thresholds.py tests/unit/test_extended_cps.py tests/unit/test_enhanced_cps_clone_diagnostics.py
  • .venv/bin/ruff format --check policyengine_us_data/utils/spm.py policyengine_us_data/calibration/calibration_utils.py policyengine_us_data/calibration/entity_clone.py policyengine_us_data/calibration/publish_local_area.py policyengine_us_data/datasets/cps/enhanced_cps.py policyengine_us_data/datasets/cps/extended_cps.py tests/unit/calibration/test_spm_thresholds.py tests/unit/test_extended_cps.py tests/unit/test_enhanced_cps_clone_diagnostics.py

@MaxGhenis MaxGhenis merged commit 324710c into main May 7, 2026
12 checks passed
@MaxGhenis MaxGhenis deleted the codex/revive-702-spm-threshold-targets branch May 7, 2026 11:13
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