Skip to content

Use named utility provider columns in Idaho LIHEAP heating - #11054

Open
hua7450 wants to merge 9 commits into
PolicyEngine:mainfrom
hua7450:id-liheap-utility-providers
Open

hua7450 wants to merge 9 commits into
PolicyEngine:mainfrom
hua7450:id-liheap-utility-providers

Conversation

@hua7450

@hua7450 hua7450 commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Idaho's PY26 Benefit Determination Chart pays different heating amounts by utility: "AVISTA & Northern Utilities", "Idaho Power & Southern Utilities" and "Rocky Mountain Power" for electric heat, and "Avista" and "Intermountain Gas" for gas heat. The model pays the Idaho Power and Intermountain Gas columns to everyone. This PR adds inputs for the household's electricity and natural gas companies and uses them to select the chart column and the matching heating-cost estimate, which sets the energy-burden group.

Fixes #11224

Changes

  • id_liheap_electricity_provider and id_liheap_natural_gas_provider, enum inputs in the Idaho LIHEAP folder, each with OTHER and UNSPECIFIED (the default).
  • Three new chart columns as parameters (matrix/electricity_northern.yaml, matrix/electricity_rocky_mountain.yaml, matrix/natural_gas_avista.yaml) and the matching provider rows in estimated_heating_costs.yaml.
  • northern_electric_providers.yaml: the companies that use the "AVISTA & Northern Utilities" column. One list feeds both formulas.
  • id_liheap and id_liheap_estimated_heating_cost select the column from the reported company. IDAHO_POWER, INTERMOUNTAIN_GAS, OTHER and UNSPECIFIED keep the Idaho Power and Intermountain Gas columns, so a household that reports no company keeps its current result.

Example

A one-person electric-heat household in heating Area II with a high energy burden, before any target-household bonus:

Electric company Estimated heating cost Payment
Idaho Power, other, or not reported $1,455 $410
Avista or another northern utility $1,585 $402
Rocky Mountain Power $1,692 $441

Where the choices come from

  • The chart names five columns. The electricity input lists Avista, Idaho Power and Rocky Mountain Power from it, and the gas input lists Avista and Intermountain Gas.
  • The chart does not say which companies are "Northern Utilities". The seven others in the electricity input (Bonners Ferry, Clearwater Power, Idaho County Light and Power, Inland Power and Light, Kootenai Electric, Northern Lights and Plummer) come from the footnote of the PY2007 Intake Manual Appendix C, with names updated from the state utility directory and Inland Power's site.
  • That footnote also names Lamb Creek Trailer Park. It is left out because its current utility identity was not established; such a household reports OTHER and uses the Idaho Power column.

Limitations

  • Heating costs, county heating areas and northern-group membership are the PY2007 Appendix C figures; Idaho publishes no current source.
  • The Appendix C column headed "Utah Power & Light" supplies the Rocky Mountain Power costs.
  • The chart leaves three cells blank: northern utilities in Area III, Rocky Mountain Power in Area I, and Avista gas in Area III. The heating-area map has no northern county in Area III and no southeastern county in Area I, so those pairs should not occur. A household reported with one of them gets the Idaho Power or Intermountain Gas column for its area.
  • No complete FY2027 chart is published, so verified_years is unchanged.

Tests

  • id_liheap.yaml Cases 15-22: every published cell of the three new columns, a household whose burden group changes with the company's cost estimate, the three blank-cell pairs, all seven added northern companies with OTHER and UNSPECIFIED, the Intermountain Gas and OTHER gas choices, and a gas-heated household whose electric company is Avista.
  • id_liheap_estimated_heating_cost.yaml Case 6: the six provider cost cells and one blank-cell pair.

The cases were not run locally after these changes; CI runs them.

Sources

axiom: needed

🤖 Generated with Claude Code

hua7450 and others added 6 commits November 16, 2026 18:02
Replace the shared electricity and natural gas provider inputs with
id_liheap_electricity_provider and id_liheap_natural_gas_provider, enums
in the Idaho LIHEAP folder that list only the companies the Idaho heating
matrix distinguishes. The matrix and estimated-cost formulas read them.

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

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##              main    #11054   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         4    +3     
  Lines           24        95   +71     
=========================================
+ Hits            24        95   +71     
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 and others added 2 commits November 20, 2026 15:26
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ider tests

- Three provider matrix files: bare date keys, key comments and `breakdown`
  metadata whose ranges match the stored areas. No value changes.
- northern_electric_providers: state why Lamb Creek Trailer Park is omitted and
  use one title for the chart PDF. estimated_heating_costs names the
  "Utah Power & Light" column.
- Tests: id_liheap Cases 15-22 use counties each utility serves, drop a
  duplicate case and add the Intermountain, OTHER and unreported gas choices;
  id_liheap_estimated_heating_cost Case 6 covers the six provider cost cells.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@hua7450
hua7450 marked this pull request as ready for review November 23, 2026 20:19

@PavelMakarchuk PavelMakarchuk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

#11054: Use named utility provider columns in Idaho LIHEAP heating

Verdict: APPROVE (head c23fab3c80)

The head did not move during the review. The head commit is a merge of main, from 2026-11-23, 3:15pm EST.

Summary

The PR adds id_liheap_electricity_provider and id_liheap_natural_gas_provider. It also adds three chart columns from the PY26 Benefit Determination Chart (Avista and Northern Utilities electric, Rocky Mountain Power electric, Avista gas), the matching PY2007 heating-cost estimates, and a list of northern electric companies. id_liheap and id_liheap_estimated_heating_cost select the column and the cost from the reported company. Blank chart cells, OTHER and UNSPECIFIED fall back to the Idaho Power and Intermountain Gas columns, so a household that reports no company keeps its current result. Every new value matches the source documents. Tests pass and CI is green.

Findings

CRITICAL

None.

SHOULD ADDRESS

None.

SUGGESTION

  1. Lamb Creek Trailer Park is left out of the northern group. policyengine_us/parameters/gov/states/id/dhw/liheap/payment/northern_electric_providers.yaml:6-8 says so. Appendix C lists it with the northern utilities. A household on that system that reports OTHER gets the Idaho Power column. Failure case: a one-person Area II household with $14,000 of income gets $394 (Idaho Power, medium burden), not $402 (northern, high burden). The comment explains the choice, and the group is very small. Optional: add a LAMB_CREEK choice, or keep the comment.
  2. A misspelled list member would fail silently. id_liheap.py:40-42 and id_liheap_estimated_heating_cost.py compare the list with decode_to_str() through np.isin. If a list member does not match an enum name, that company falls back to the Idaho Power column with no error. Case 21 tests all seven added companies, so this risk is covered today. Optional: add a small check that each list member is a member of IDLIHEAPElectricityProvider.

What I checked

  • Head and state. The head is c23fab3c80. It merges main at b3edc0446b (the current tip). A merge with main is clean. GitHub reports MERGEABLE, BLOCKED (review needed). No other open PR touches the Idaho LIHEAP folders.

  • PY26 Benefit Determination Chart (page 1), fetched through the Wayback copy because the liheapch.acf.gov certificate chain fails. Every new cell matches:

    • Avista and Northern Utilities: Area I $322 / $335 / $348; Area II $371 / $387 / $402.
    • Rocky Mountain Power: Area II $407 / $424 / $441; Area III $461 / $481 / $500.
    • Avista gas: Area I $168 / $176 / $183; Area II $194 / $203 / $211.

    The order is low, medium, high, which is groups 1 to 3 in the parameters. The chart leaves northern Area III, Rocky Mountain Power Area I and Avista gas Area III blank, as the PR says.

  • Appendix C (PY07), archived copy. Avista gas $875 (I) and $1,200 (II). Northern Utilities $1,450 (I) and $1,585 (II). Utah Power and Light $1,692 (II) and $1,836 (III). All match estimated_heating_costs.yaml. The northern footnote names AVISTA, Bonners Ferry, Plummer, Clearwater Power, Idaho County Power and Light, Inland Light and Power, Kootenai Electric, Lamb Creek Trailer Park and Northern Lights. That is the PR list plus Lamb Creek. The southern footnote names Fall River, Lower Valley, Idaho Falls and others. These fall back to the Idaho Power column through OTHER, which is correct.

  • Utility names. The OEMR utility directory (200) lists Bonners Ferry Light and Water, Clearwater Power, Idaho County Light and Power, Kootenai Electric Cooperative, Northern Lights Incorporated and Plummer Electric Department. Inland Power and Light is not in it. The PR cites inlandpower.com for that company (200).

  • Formula, id_liheap.py:34-59 and id_liheap_estimated_heating_cost.py. The provider masks are vectorized. The index expressions min_(area, 2) and max_(area, 2) stay inside each parameter's breakdown, because the masks require area < 3 or area > 1. In the cost variable, the masks use the raw area, but the lookup uses the clipped area, and the final where sets an unknown area (0) to $0. SOLAR uses the electric column, as before. A period before 2025-10-01 (2025) still computes. I checked a northern company there: $402.

  • Tests. At the head, the Idaho LIHEAP folder passes (73 tests). On main, it passes (64 tests).

  • Hand-computed cases (2026, one person, $14,000 of countable income, eligibility set to true):

    • Kootenai County, Idaho Power: cost $1,455 < 11% of income ($1,540), so medium burden, $394.
    • Kootenai County, Kootenai Electric: cost $1,585 ≥ $1,540, so high burden, $402. The company changes the burden group.
    • Bonneville County (Area III), Northern Lights: blank cell, so Idaho Power Area III, cost $1,605, high burden, $464.
    • Ada County (Area I), Rocky Mountain Power: blank cell, so Idaho Power Area I, cost $1,335, medium burden, $342.
    • Bonneville County, gas, Avista: blank cell, so Intermountain Area III, cost $1,207, $166.
    • Latah County (Area I), solar heat, Clearwater Power: northern Area I, cost $1,450, medium burden, $335.

    All six results match.

  • Format and changelog. ruff format --check and ruff check pass on the four changed Python files. The fragment changelog.d/id-liheap-utility-providers.added.md is top level and the type is valid.

  • CI. All 42 checks pass, including codecov patch and project.

  • Partner tests. No file under tests/policy/baseline/partners/ changes.

Not verified

  • The accepted FY2027 Idaho plan (sections 2.5-2.6). The Wayback copy returns 404, and the direct link fails on the certificate chain. The PR cites it only in the body, for the statement that no FY2027 chart exists.
  • Whether Idaho still uses the PY2007 heating costs and the northern-group membership today. Idaho publishes no current source. The PR and the parameter comments state this limit.
  • Microsimulation impact. The defaults are UNSPECIFIED, so I expect no change. CI Microsimulation passes.

This branch has not been deployed

No deployments
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.

Implement Idaho LIHEAP utility provider columns

2 participants