Fix get_irs_cpi 12-month CPI window - #9198
Open
saisharan0103 wants to merge 2 commits into
Open
Conversation
… documents (and IRS practice uses) the 12 months ending August Closes PolicyEngine#9105
…ow; format The Sep-Aug window correction shifts gov.irs.uprating-projected values by a few dollars, so: RI 2027 SS-modification boundary cases move to the corrected projected limits (single 112,750, joint 140,950 — inputs shifted, intent preserved: at-limit stays ineligible, one dollar below stays eligible); RI high-earner, RI integration, MN HF4890, and CA AB2591 projected-value pins updated to the corrected-window outputs; ruff format on the new window test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #9105 reports that get_irs_cpi documents and intends to follow IRS practice by averaging chained CPI-U over the 12 months ending in August, but the implementation starts 12 months before the August instant and iterates 12 values. That selects August of the prior year through July of the target year, excluding the target year's August value.
This changes the loop start to 11 months before the August instant so the averaged window is September of the prior year through August of the target year, inclusive.
A regression test now computes the expected average from explicit September-August monthly C-CPI-U values and verifies get_irs_cpi matches that window, while demonstrating the result differs from the old August-July window.
Modified files:
ruff check policyengine_us/parameters/uprating_extensions.py policyengine_us/tests/policy/baseline/parameters/test_uprating_extensions.pyreports no new findings on the changed files.