Skip to content

Replace IL LIHEAP simplified payment model with full benefit matrix#7963

Open
hua7450 wants to merge 6 commits intoPolicyEngine:mainfrom
hua7450:il-liheap-benefit-matrix
Open

Replace IL LIHEAP simplified payment model with full benefit matrix#7963
hua7450 wants to merge 6 commits intoPolicyEngine:mainfrom
hua7450:il-liheap-benefit-matrix

Conversation

@hua7450
Copy link
Copy Markdown
Collaborator

@hua7450 hua7450 commented Apr 9, 2026

Summary

  • Replaces the simplified IL LIHEAP min/max payment model with the full FY2024 benefit matrix
  • Adds 4 matrix parameter files (all electric, nat gas, propane/fuel oil, cash) covering 4 income brackets × 6 household sizes
  • Adds bracket parameter for income bracket derivation (0-50%, 51-100%, 101-150%, 151-200% FPL)
  • Infers fuel type from existing expense variables (gas, fuel oil, bottled gas, coal, metered gas, heat in rent)
  • Caps non-cash benefits at actual heating expenses (7 expense categories)
  • Removes unused base_amount/min.yaml and base_amount/max.yaml parameters
  • Updates crisis_amount parameter with corrected FY2024 value and state plan references

Regulatory Authority

Design Decisions

  • Fuel type inference: Derived from expense variables — heat_in_rent → CASH, fuel_oil/coal → PROPANE_FUEL_OIL, gas/bottled_gas/metered_gas → NAT_GAS_OTHER, otherwise ALL_ELECTRIC. User can still override explicitly.
  • Expense cap: Non-cash benefits capped at min(matrix_amount, sum of 7 heating expenses)electricity_expense, gas_expense, fuel_oil_expense, heating_cooling_expense, bottled_gas_expense, metered_gas_expense, coal_expense. Consistent with MA and DC LIHEAP. Cash (heat in rent) is a direct payment with no expense cap.
  • Bracket thresholds: 0.51/1.01/1.51 (not 0.5001) per PDF labels "0% TO 50%", "51% TO 100%", etc.
  • FY2024 only: FY2025 matrix introduces LID/Non-LID natural gas split — planned for follow-up PR.

Files

New

  • parameters/gov/states/il/dceo/liheap/payment/matrix/ — 4 matrix YAML files
  • parameters/gov/states/il/dceo/liheap/payment/income_bracket.yaml — bracket parameter
  • variables/gov/states/il/dceo/liheap/il_liheap_fuel_type.py — fuel type enum + inference from expenses
  • variables/gov/states/il/dceo/liheap/il_liheap_income_bracket.py — derived from FPL %

Modified

  • variables/gov/states/il/dceo/liheap/payment/il_liheap_base_payment.py — matrix lookup + expense cap
  • variables/gov/states/il/dceo/liheap/eligibility/il_liheap_eligible.py — immigration comment
  • parameters/gov/states/il/dceo/liheap/payment/crisis_amount/max.yaml — corrected FY2024

Removed

  • parameters/gov/states/il/dceo/liheap/payment/base_amount/max.yaml — superseded by matrix
  • parameters/gov/states/il/dceo/liheap/payment/base_amount/min.yaml — superseded by matrix

Test plan

  • 25 IL LIHEAP tests pass (8 unit + 7 integration + existing eligibility)
  • All tests verify fuel type inference from expenses (no explicit il_liheap_fuel_type override)
  • Tests cover: gas, fuel oil, bottled gas, coal, metered gas, heat in rent, electricity-only
  • Tests cover: expense cap, heating_cooling_expense in cap, cash bypass
  • CI passes

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e8a542a) to head (138c22c).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7963   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         4    +3     
  Lines           17        72   +55     
=========================================
+ Hits            17        72   +55     
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.

hua7450 and others added 5 commits April 9, 2026 11:17
These are now superseded by the full benefit matrix lookup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…xpenses

- Derive CASH fuel type from heat_expense_included_in_rent
- Fix income bracket thresholds to 0.51/1.01/1.51 (matching PDF labels)
- Cap non-cash benefits at actual heating expenses (electricity + gas + fuel oil)
- Use SPMUnit utility variables consistent with MA/DC LIHEAP
- Fix parameter descriptions per PolicyEngine standards
- Update tests to use SPMUnit expense variables

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Derive fuel type from gas/fuel_oil/bottled_gas/coal/metered_gas expenses
- Add heating_cooling_expense, bottled_gas_expense, metered_gas_expense,
  coal_expense to expense cap
- Rewrite tests to verify inference logic (no explicit fuel type override)
- Add test cases for bottled gas, coal, metered gas, heating_cooling_expense

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hua7450 hua7450 requested a review from PavelMakarchuk April 9, 2026 19:27
Copy link
Copy Markdown
Collaborator

@PavelMakarchuk PavelMakarchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review found a likely regression.

Summary: The PR introduces a breaking regression for existing IL LIHEAP inputs by no longer honoring generic heating expenses when capping the base benefit.

Finding:

  • policyengine_us/variables/gov/states/il/dceo/liheap/payment/il_liheap_base_payment.py:37
  • Existing heating_expense_person inputs now appear to produce a zero LIHEAP payment.
  • origin/main computes IL LIHEAP from heating_expense_person, but this PR caps non-cash benefits using only utility-specific SPM-unit expenses. A household still providing the previously supported input shape, for example heating_expense_person: 1000 with no gas_expense or electricity_expense, now gets il_liheap_base_payment = 0 instead of the prior positive payment because heating_expenses becomes 0 and the inferred fuel type falls back to ALL_ELECTRIC.
  • Unless heating_expense_person is being explicitly deprecated everywhere, this looks like a silent underpayment regression and needs either backward-compatible support or a migration path plus coverage.

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.

2 participants