Skip to content

Support lagged years in the shared federal poverty guideline helper - #9731

Merged
hua7450 merged 2 commits into
PolicyEngine:mainfrom
hua7450:liheap-fpg-helper
Sep 30, 2026
Merged

hua7450 merged 2 commits into
PolicyEngine:mainfrom
hua7450:liheap-fpg-helper

Conversation

@hua7450

@hua7450 hua7450 commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

LIHEAP implementations repeat the calculation of a prior year's federal poverty guideline. Extend the existing fpg() helper with an optional year_lag=0, so callers can reuse that calculation while supplying their own household size, policy rate, rounding, and size limits.

Massachusetts LIHEAP is the first converted caller. It continues to use the current SPM unit size and the preceding October's guideline date. Existing callers omit the new argument and retain their current-date lookup. The helper returns the unrounded annual guideline and preserves the lookup month and day when shifting the year.

This is the shared prerequisite for the Kansas, Nebraska, Kentucky, and North Carolina LIHEAP refactors. It changes no benefit parameters and adds no input variables.

Validation:

  • 197 YAML cases passed across Massachusetts LIHEAP and existing helper consumers, including Medicaid, Missouri CHIP, and state income/copay calculations.
  • Added one vectorized YAML case covering distinct SPM/tax-unit sizes, prior-year versus current-year guidelines, and a household above eight people.
  • An independent check verified 63 date/lag combinations across contiguous-US, Alaska, and Hawaii guidelines, including annual/monthly periods, integer years, date strings, dates, and instants.
  • make format (Ruff formatting and lint) and git diff --check passed.

Related state drafts: #9663, #9723, #9725, #9726. This helper PR should merge first; the state PRs can then use the common implementation.

@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (909176a) to head (f4192ac).
⚠️ Report is 106 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #9731   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         2    -2     
  Lines           76        33   -43     
  Branches         2         0    -2     
=========================================
- Hits            76        33   -43     
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 Harness.
📢 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.

@hua7450
hua7450 marked this pull request as ready for review September 30, 2026 22:32
@hua7450
hua7450 merged commit 8338104 into PolicyEngine:main Sep 30, 2026
37 checks passed
hua7450 added a commit to hua7450/policyengine-us that referenced this pull request Oct 1, 2026
Brings in the shared federal poverty guideline helper with year_lag (PolicyEngine#9731).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
hua7450 added a commit to hua7450/policyengine-us that referenced this pull request Oct 1, 2026
… limit

Replace the Kansas-only tools/liheap.py helper with fpg(..., year_lag=...) from
the shared helper merged in PolicyEngine#9731. The 150% rate, separately rounded monthly
increment and eight-person breakpoint stay in ks_liheap_income_limit, which
reproduces the previous results for FY2025-FY2027 at every household size.
Also records the verified-years note on ks_liheap and the KEESM 13330
household-size comment.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
hua7450 added a commit that referenced this pull request Oct 3, 2026
* Implement Kansas LIEAP heating benefit

Adds ks_liheap: eligibility (150% of prior-year FPG on a citizenship-adjusted
household size, categorical TANF/SSI/SNAP route, energy vulnerability and
subsidized heat-in-rent exclusion), countable gross income, and the published
FY2025 (100%) and FY2026 (80% adjusted) benefit matrices by fuel, income band,
utility rate tier, dwelling type and household size group, with the $100/$130
minimum benefit.

Sources: KEESM 13000-13400; Kansas LIHEAP State Plans FFY2025/FFY2026;
LIHEAP Clearinghouse Kansas benefit matrices FY2025/FY2026.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6rihVz3MtZQKCzzkCib35

* Validate Kansas LIEAP rules and fix income and heating eligibility

* Refactor Kansas LIEAP income limits around shared FPG rules

* Simplify Kansas LIEAP self-employment income inputs

* Refine Kansas LIEAP income coverage and references

* Consolidate Kansas LIEAP tests

Fold the mixed-state vectorized case into ks_liheap.yaml, drop the
review_regressions file and the boundary and lookup cases that
duplicated coverage held elsewhere, and assert eligibility alongside
the zero benefit where a case exercises an ineligibility gate.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Cite dated KEESM editions in Kansas LIEAP references

Replace every undated keesm/current link in the Kansas LIEAP variables
and parameters with the October 2024 and January 2026 editions, name
the edition in parameter reference titles, and point the test-file
headers at the same editions with combined page anchors.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Use the shared federal poverty guideline helper for the Kansas income limit

Replace the Kansas-only tools/liheap.py helper with fpg(..., year_lag=...) from
the shared helper merged in #9731. The 150% rate, separately rounded monthly
increment and eight-person breakpoint stay in ks_liheap_income_limit, which
reproduces the previous results for FY2025-FY2027 at every household size.
Also records the verified-years note on ks_liheap and the KEESM 13330
household-size comment.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Use ordinary_dividend_income in Kansas LIEAP interest and dividend income

Replace the deprecated dividend_income alias in the formula and send qualified_dividend_income in the tests that used it. Expected values are unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Address review nits in Kansas LIEAP: descriptions, citations, test labels and edge cases

- Re-template 14 parameter descriptions and name the pages in combined reference anchors
- Cite the FY2025 plan, KEESM 13361 and the July 2025 edition; fix the FY2025 matrix and plan anchors that missed pages
- Drop the redundant select branch in ks_liheap_fuel_category; note the household-size interpretation and the estimated $130 minimum
- Fix four test page cites and the 80 percent comment, renumber case labels, format numbers
- Add cases for heat in rent with an unspecified fuel, negative countable income and strike, general assistance and workers' compensation income

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Shorten the Kansas LIEAP registry note

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Address second Kansas LIEAP review

Give every multi-page reference a single page in the link, with the pages
named in the title or in a comment. Count partnership and S corporation
income as earned income, floored at zero like the other business sources
(KEESM 6300 and 6313), and farm rental income as unearned income (KEESM
6313). State the exact effective-date range in the rounding comment and
correct two test header page cites.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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