Skip to content

Expose state-filtered electricity and gas provider choices - #1712

Closed
hua7450 wants to merge 2 commits into
mainfrom
utility-provider-options
Closed

hua7450 wants to merge 2 commits into
mainfrom
utility-provider-options

Conversation

@hua7450

@hua7450 hua7450 commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1711

Superseded by PolicyEngine/policyengine-us#11052. Partners can filter the provider catalog shipped with the US model.

Partners can request GET /us/variables/electricity_provider/options?state=IL or substitute natural_gas_provider. The response contains an ordered list of values to submit and labels to display. A state with no named distributor in the model still returns the choices for an unlisted or unknown company. Customers select the distribution company on their bill because a listed provider may serve only part of a state.

The lookup reads the running US model’s states_by_value metadata. On the hosted API, the optional version query accepts the same current, frontier, or active exact package version as a calculation. A worker whose model lacks the mapping returns 404. Local containers use their installed model. The endpoint uses the standard bearer authentication and rate limit.

The verified territories come from the shared model PR. Deploy a model version containing that change to serve these choices. The OpenAPI specification and README include the partner-facing contract.

Verification

  • Repository format check passed.
  • The full unit and legacy test command passed 826 tests with one skip. The skipped test checks the analytics writer’s isolated installation in a separate CI environment.
  • All eight authenticated integration tests passed with the repository’s static token fixture.
  • Loaded both PR branches together and made 102 local endpoint requests, one per fuel for each of the 50 states and DC. All returned the expected enum values and labels in model order. The comparison used the federal company records and Rocky Mountain Power’s brand territory.

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.

Expose state-filtered utility provider choices for household inputs

1 participant