From ae5c561e7156f00f6b9916b686880851056893dc Mon Sep 17 00:00:00 2001 From: Anthony Volk <14987227+anth-volk@users.noreply.github.com> Date: Mon, 12 Oct 2026 23:40:10 +0400 Subject: [PATCH] Give skill examples a county and refresh their asserted values 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 --- skills/policyengine-healthcare/SKILL.md | 4 ++-- skills/policyengine-us/SKILL.md | 16 ++++++++-------- skills/policyengine/SKILL.md | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/skills/policyengine-healthcare/SKILL.md b/skills/policyengine-healthcare/SKILL.md index 24a93dc..c700f8e 100644 --- a/skills/policyengine-healthcare/SKILL.md +++ b/skills/policyengine-healthcare/SKILL.md @@ -58,11 +58,11 @@ import policyengine as pe r = pe.us.calculate_household( people=[{"age": 45, "employment_income": 35_000}], tax_unit={"filing_status": "SINGLE"}, - household={"state_code": "TX"}, + household={"state_code": "TX", "county_fips": "48201"}, year=2026, extra_variables=["aca_ptc", "household_net_income_including_health_benefits"], ) -assert round(r.tax_unit.aca_ptc, 2) == 6_250.38 # a real PTC... +assert round(r.tax_unit.aca_ptc, 2) == 6_635.45 # a real PTC... # ...but it is NOT in default net income; the gap is exactly the PTC: gap = (r.household.household_net_income_including_health_benefits - r.household.household_net_income) diff --git a/skills/policyengine-us/SKILL.md b/skills/policyengine-us/SKILL.md index d103193..2addda9 100644 --- a/skills/policyengine-us/SKILL.md +++ b/skills/policyengine-us/SKILL.md @@ -95,7 +95,7 @@ def odc(dependent): return pe.us.calculate_household( people=[{"age": 45, "employment_income": 40_000}, kid], tax_unit={"filing_status": "HEAD_OF_HOUSEHOLD"}, - household={"state_code": "CA"}, + household={"state_code": "CA", "county_fips": "06037"}, year=2026, ).tax_unit.ctc @@ -120,13 +120,13 @@ r = pe.us.calculate_household( {"age": 5}, ], tax_unit={"filing_status": "JOINT"}, - household={"state_code": "NY"}, + household={"state_code": "NY", "county_fips": "36061"}, year=2026, ) assert round(r.tax_unit.ctc) == 4_400 # 2 children x $2,200 (OBBBA, 2026) assert round(r.tax_unit.eitc) == 7_316 # federal EITC (tax_unit) -assert round(r.spm_unit.snap) == 7_364 # annual = sum of 12 monthly allotments -assert round(r.household.household_net_income) == 62_681 +assert round(r.spm_unit.snap) == 8_061 # annual = sum of 12 monthly allotments +assert round(r.household.household_net_income) == 47_929 ``` Here `income_tax` is about −$10,691 (refundable EITC + CTC exceed liability), so @@ -144,7 +144,7 @@ import policyengine as pe r = pe.us.calculate_household( people=[{"age": 35, "employment_income": 25_000}, {"age": 8}], tax_unit={"filing_status": "HEAD_OF_HOUSEHOLD"}, - household={"state_code": "NY"}, + household={"state_code": "NY", "county_fips": "36061"}, year=2026, extra_variables=["in_poverty", "person_in_poverty", "is_child"], ) @@ -218,12 +218,12 @@ import policyengine as pe r = pe.us.calculate_household( people=[{"age": 30, "employment_income": 20_000}, {"age": 4}], tax_unit={"filing_status": "HEAD_OF_HOUSEHOLD"}, - household={"state_code": "CA"}, + household={"state_code": "CA", "county_fips": "06037"}, year=2026, extra_variables=["ca_eitc"], ) assert round(r.tax_unit.eitc) == 4_427 # federal EITC -assert round(r.tax_unit.ca_eitc, 2) == 410.16 # CalEITC (state) +assert round(r.tax_unit.ca_eitc, 2) == 401.89 # CalEITC (state) assert r.tax_unit.state_income_tax < 0 # refundable CA credits exceed liability ``` @@ -236,7 +236,7 @@ SNAP is the US benefit whose timing most often surprises analysts. Everything be against the model source. **SNAP is monthly.** `snap` and its inputs have `definition_period = MONTH`. When -`calculate_household` reports an annual figure (like the $7,364 above), it is the **sum of twelve +`calculate_household` reports an annual figure (like the $8,061 above), it is the **sum of twelve monthly allotments** — not one annual calculation. That is why SNAP produces partial-year cliffs that annual-only reasoning misses. diff --git a/skills/policyengine/SKILL.md b/skills/policyengine/SKILL.md index dbb89ce..870fe07 100644 --- a/skills/policyengine/SKILL.md +++ b/skills/policyengine/SKILL.md @@ -53,12 +53,12 @@ import policyengine as pe result = pe.us.calculate_household( people=[{"age": 40, "employment_income": 50_000}, {"age": 8}], tax_unit={"filing_status": "HEAD_OF_HOUSEHOLD"}, - household={"state_code": "CA"}, + household={"state_code": "CA", "county_fips": "06037"}, year=2026, extra_variables=["income_tax"], ) assert result.tax_unit.ctc == 2_200 # OBBBA CTC, 2026 -assert round(result.household.household_net_income) == 46_358 +assert round(result.household.household_net_income) == 46_369 print(result.spm_unit.snap, result.tax_unit.eitc, result.tax_unit.income_tax) ``` @@ -81,13 +81,13 @@ import policyengine as pe baseline = pe.us.calculate_household( people=[{"age": 40, "employment_income": 50_000}, {"age": 8}], tax_unit={"filing_status": "HEAD_OF_HOUSEHOLD"}, - household={"state_code": "CA"}, + household={"state_code": "CA", "county_fips": "06037"}, year=2026, ) reformed = pe.us.calculate_household( people=[{"age": 40, "employment_income": 50_000}, {"age": 8}], tax_unit={"filing_status": "HEAD_OF_HOUSEHOLD"}, - household={"state_code": "CA"}, + household={"state_code": "CA", "county_fips": "06037"}, year=2026, reform={"gov.irs.credits.ctc.amount.base[0].amount": 3_000}, ) @@ -116,7 +116,7 @@ import policyengine as pe result = pe.us.calculate_household( people=[{"age": 40}], tax_unit={"filing_status": "SINGLE"}, - household={"state_code": "TX"}, + household={"state_code": "TX", "county_fips": "48201"}, year=2026, axes=[[{"name": "employment_income", "min": 0, "max": 200_000, "count": 401}]], )