Fix asset stock period handling#8298
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8298 +/- ##
===========================================
- Coverage 100.00% 97.56% -2.44%
===========================================
Files 3 38 +35
Lines 63 452 +389
Branches 0 3 +3
===========================================
+ Hits 63 441 +378
- Misses 0 10 +10
- Partials 0 1 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
30af0c8 to
f1a94d5
Compare
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.
Summary
Fixes #8300.
Context
PolicyBench error review found cases where SNAP categorical eligibility used monthly TANF non-cash asset tests. Because asset balances were treated as annual flows, a $15,000 asset balance appeared as $1,250 in monthly formulas and could incorrectly pass state asset tests.
The same review also surfaced a separate Texas SNAP BBCE gap: PE-US documented that excess vehicle value above the Texas vehicle exemption was not modeled for the TANF non-cash asset test used by SNAP BBCE. This PR models excess vehicle value using household vehicle value and the Texas exemption. The current Texas exemption is $22,500 for the first vehicle under HB 1287, effective September 1, 2023; $15,000 remains as the historical pre-HB 1287 value.
PolicyEngine Core already preserves stock quantities across periods when variables declare
quantity_type = STOCK, so the period-handling fix is in PE-US rather than core.Related PolicyBench prompt follow-up: PolicyEngine/policybench#19.
Tests
uv run policyengine-core test policyengine_us/tests/policy/baseline/gov/hhs/tanf/non_cash/meets_tanf_non_cash_asset_test.yaml policyengine_us/tests/policy/baseline/gov/usda/snap/eligibility/snap_assets.yaml -c policyengine_usuv run --frozen python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/gov/hhs/tanf/non_cash policyengine_us/tests/policy/baseline/gov/usda/snap/eligibility -c policyengine_usuv run --frozen python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/gov/states/dc/dhs/ccsp/eligibility/dc_ccsp_asset_eligible.yaml policyengine_us/tests/policy/baseline/gov/states/il/dhs/aabd/asset/il_aabd_asset_value_eligible.yaml policyengine_us/tests/policy/baseline/gov/states/il/dhs/aabd/asset/il_aabd_countable_vehicle_value.yaml policyengine_us/tests/policy/baseline/gov/states/il/hfs/hbwd/asset/il_hbwd_countable_assets.yaml policyengine_us/tests/policy/baseline/gov/states/il/hfs/hbwd/eligibility/il_hbwd_asset_eligible.yaml policyengine_us/tests/policy/baseline/gov/states/ma/dta/tcap/eaedc/eligibility/financial/ma_eaedc_assets_limit_eligible.yaml policyengine_us/tests/policy/baseline/gov/states/ma/eec/ccfa/eligibility/ma_ccfa_asset_eligible.yaml -c policyengine_usuv run --frozen python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/gov/states/tn/dhs/ff/tn_ff_countable_resources.yaml policyengine_us/tests/policy/baseline/gov/states/wa/dshs/tanf/wa_tanf_countable_resources.yaml policyengine_us/tests/policy/baseline/gov/states/tx/tanf/resources/tx_tanf_countable_resources.yaml policyengine_us/tests/policy/baseline/gov/states/wi/dcf/works/wi_works_countable_resources.yaml policyengine_us/tests/policy/baseline/gov/local/ca/la/general_relief/eligible/la_general_relief_motor_vehicle_value_eligible.yaml policyengine_us/tests/policy/baseline/gov/local/ca/riv/general_relief/ca_riv_general_relief_countable_vehicle_value.yaml policyengine_us/tests/policy/baseline/gov/states/ca/cdss/tanf/cash/eligibility/ca_tanf_vehicle_value_eligible.yaml policyengine_us/tests/policy/baseline/gov/states/ca/cdss/capi/resources/ca_capi_countable_vehicle_value.yaml policyengine_us/tests/policy/baseline/gov/states/ca/cdss/capi/resources/ca_capi_resources.yaml policyengine_us/tests/policy/baseline/gov/states/mt/dhs/tanf/eligibility/mt_tanf_countable_resources.yaml policyengine_us/tests/policy/baseline/gov/states/nm/hca/nm_works/resources/nm_works_countable_non_liquid_resources.yaml policyengine_us/tests/policy/baseline/gov/states/nm/hca/nm_works/resources/nm_works_countable_resources.yaml policyengine_us/tests/policy/baseline/gov/states/dc/dhs/tanf/eligibility/dc_tanf_countable_resources.yaml policyengine_us/tests/policy/baseline/gov/states/in/fssa/tanf/resources/in_tanf_countable_resources.yaml -c policyengine_usuv run --frozen python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/gov/local/ca/ala/eligibility/ca_ala_general_assistance_personal_property_eligible.yaml policyengine_us/tests/policy/baseline/gov/local/ca/la/general_relief/eligible/la_general_relief_personal_property_eligible.yaml policyengine_us/tests/policy/baseline/gov/local/ca/la/general_relief/eligible/la_general_relief_home_value_eligible.yaml policyengine_us/tests/policy/baseline/gov/states/wa/dshs/tanf/wa_tanf_countable_resources.yaml policyengine_us/tests/policy/baseline/gov/states/wv/tax/income/credits/sctc/wv_sctc.yaml policyengine_us/tests/policy/baseline/gov/states/wv/tax/income/exemptions/homestead_exemption/wv_homestead_exemption.yaml policyengine_us/tests/policy/baseline/gov/irs/integration/qbid.yaml policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/qualified_business_income_deduction_person.yaml policyengine_us/tests/policy/baseline/gov/irs/tax/estate/estate_tax.yaml policyengine_us/tests/policy/baseline/gov/irs/tax/estate/estate_tax_before_credits.yaml policyengine_us/tests/policy/baseline/gov/irs/credits/estate/estate_tax_credit.yaml -c policyengine_usuv run --frozen ruff format --checkuv run --frozen ruff check