Repository navigation
Conversation
) FNS counts households as a fiscal-year average of monthly caseloads. The take-up fill read December eligibility (policyengine-core's answer to a year request for the monthly is_snap_eligible) and the household target counted any SPM unit with positive annual snap as a whole household. Both now count a unit by the share of the year's months with a positive benefit: - the eligibility pass can return each unit's share of months with a positive snap_if_takes_up; the take-up stage weights the rate prior, the greedy count calibration and its diagnostics by snap_month_weight (weight times share); - a new register key, indicator_months: mean, averages a count target's indicator over the year's months, and the household target uses it. Without month shares the stage falls back to the December flag, so the default eligibility pass and its frozen main-baseline batch tests are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DTrim99
marked this pull request as ready for review
December 2, 2026 18:33
This was referenced Dec 2, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1713.
What changes
FNS counts SNAP households as an average over the fiscal year's months. The build counted them two other ways:
is_snap_eligiblefor the year, which policyengine-core answers with December. A unit eligible only earlier in the year sat outside the count but kept its drawn flag, and a unit eligible from October counted as a whole household. Units eligible in December with a zero benefit all year counted toward the FNS caseload too.snapas a whole household.Both now count each SPM unit by the share of the year's twelve months in which it has a positive benefit.
snap_state_take_up). The eligibility pass can return each unit's share of months with a positivesnap_if_takes_up(benefit_month_share=True). The stage's domain is units with any such month, and a newsnap_month_weight(unit weight times share) weights the rate prior, the greedy count calibration (the manifest'sweight) and the diagnostics. Without shares, the stage falls back to the December flag as a 0/1 share, so the old basis is still available and the frozen main-baseline batch-loop tests are unchanged. Diagnostics move to schema 2 withbenefit_month_basis.snap_households). A new register key,indicator_months: mean, averages a count target's indicator over the year's months. The household collapse is linear, so the column is the mean of the twelve monthly columns. The key applies only toindicator_sumandless_than_indicator_sum; an amount refuses it._calculate_arrayand the two household-value evaluators take aperiod, defaulting toPERIOD.What it should do to a build
From #1713's measurement on
populace-us-2024-spm-20260915(policyengine-us 2.145.3):Moving builds to policyengine-us 2.153.1 or later removes the Idaho and Colorado steps at their source. This PR fixes the counting in every state either way.
Cost
The eligibility pass computes
snap_if_takes_upfor twelve months instead ofis_snap_eligiblefor December. The target pass readssnapmonthly, which the annual calculation has already cached.Interaction with #1850
#1850's persons target (#1843) uses the annual basis. Whichever of the two merges second should add
indicator_months: meanto the persons entry, so both targets count the same units the same way.Interaction with #1857
#1857 (#1712 part 2) changes the same stage's draw (
snap_fill_draw), and this PR changes its count weight. They edit neighboring lines of the stage module and of thecalibrate_binary_assignmentoperation, so whichever merges second needs a small rebase. They don't interact in behavior.Tests
indicator_monthsrefuses amounts and other values.engine_workflow/us/test_us_snap_average_month_targets.py): on the real-engine fixture, the month-mean target column equals the mean of monthlysnap > 0collapsed to households and never exceeds the annual indicator, and the batched month share equals the unbatched one and the engine's monthly values.--checkruns andci_test_plan.py verify, all clean. TheINDICATOR_LEDGER_TARGETSdigest pin moves.🤖 Generated with Claude Code