Skip to content

Give skill examples a county and refresh their asserted values - #98

Closed
anth-volk wants to merge 1 commit into
mainfrom
fix-skill-examples-county
Closed

anth-volk wants to merge 1 commit into
mainfrom
fix-skill-examples-county

Conversation

@anth-volk

Copy link
Copy Markdown

What and why

The skill-examples check fails on any PR right now (it surfaced on #97). The current policyengine-us (2.2.1, via policyengine 6.3.0 and spm-calculator 1.0.0) never infers SPM geography from a missing county: a household with only state_code raises

SPMInputError: County selection has no county FIPS input (''): send county_fips as a five-digit string (for example "06037"), or select geography_kind="national" in the spm configuration

so 8 of the verified examples failed. This adds a county to each of the 9 state-only households, using the same form as policyengine's own docstring ({"state_code": "NY", "county_fips": "36061"}):

State County FIPS
CA Los Angeles 06037
TX Harris 48201
NY New York 36061

Asserted values that changed (please review)

Once the examples run, some asserted numbers no longer match. Only the ACA PTC depends on the county chosen (Anderson County, TX reproduces the old 6,250.38). The rest come out the same for any county, so they reflect model changes since this check last passed on main (2026-09-13):

Example Value Old New
policyengine #0 (CA) household_net_income 46,358 46,369
policyengine-healthcare #0 (TX) aca_ptc 6,250.38 6,635.45 (county-dependent)
policyengine-us #1 (NY) snap 7,364 8,061
policyengine-us #1 (NY) household_net_income 62,681 47,929
policyengine-us #4 (CA) ca_eitc 410.16 401.89

The prose quoting the SNAP figure is updated to match. The NY net income drop of about $15k is large enough that someone who knows the US model should confirm it is an intended model change rather than a regression. That part of this PR is the one to check.

Test plan

  • pytest tests/test_skill_examples.py with policyengine[us] installed as in CI: 18 passed, 1 skipped (slow)
  • uv run pytest --ignore=tests/test_skill_examples.py: 178 passed
  • Confirm the NY household_net_income change (62,681 → 47,929) is expected

🤖 Generated with Claude Code

policyengine-us now requires an explicit SPM geography: a household
without county_fips raises SPMInputError, so 8 verified examples
failed. Add a county to each state-only household (Los Angeles 06037,
Harris 48201, New York 36061) and update the values the current model
returns for them.

Co-Authored-By: Claude Opus 5.5 <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