Skip to content

[codex] Recompute future SPM thresholds#7943

Draft
MaxGhenis wants to merge 1 commit intoPolicyEngine:mainfrom
MaxGhenis:codex/spm-threshold-recompute
Draft

[codex] Recompute future SPM thresholds#7943
MaxGhenis wants to merge 1 commit intoPolicyEngine:mainfrom
MaxGhenis:codex/spm-threshold-recompute

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

What changed

  • stop treating spm_unit_spm_threshold as a generic uprated input in future years
  • add a shared SPM reference-threshold helper and rebuild future thresholds from prior-year implied geography, current tenure, and current SPM-unit composition
  • add regression tests covering composition changes, tenure changes, and explicit future-year overrides

Why

SPM thresholds should not just be carried forward by CPI on the total stored amount. That loses the structure we built this for: the reference threshold, the equivalence scale, and the unit-specific geographic adjustment.

Impact

Future-year SPM thresholds in policyengine-us now respond to household composition and tenure changes while preserving the implied geographic adjustment from the stored base-year threshold.

Root cause

spm_unit_spm_threshold was defined as an input variable with gov.bls.cpi.cpi_u uprating, so future periods inherited a simple scalar uprate of the total threshold instead of recomputing the threshold components.

Validation

  • PYTHONPATH=. pytest -q policyengine_us/tests/policy/baseline/household/income/spm_unit

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (20b8599) to head (d806fb0).
⚠️ Report is 38 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7943   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           17        32   +15     
=========================================
+ Hits            17        32   +15     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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