-
Notifications
You must be signed in to change notification settings - Fork 201
Move all stochastic randomness to data package for deterministic country package #7326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…try package Remove all random() calls and seed variables from the country package. Takeup variables (ACA, SNAP, Medicaid) are now formula-less with default True. WIC uses draw variables instead of random(). SSI resource test uses only policy logic. Add state-specific Medicaid rates, Section 1931 deprivation rules, Head Start/Early Head Start takeup variables. Supersedes #6635, #7317. Fixes #7316. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7326 +/- ##
============================================
- Coverage 100.00% 86.56% -13.44%
============================================
Files 3 12 +9
Lines 54 134 +80
Branches 1 0 -1
============================================
+ Hits 54 116 +62
- Misses 0 18 +18
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:
|
Co-Authored-By: Claude Opus 4.6 <[email protected]>
policyengine_us/variables/gov/usda/wic/wic_nutritional_risk_draw.py
Outdated
Show resolved
Hide resolved
Remove draw variables; would_claim_wic and wic_nutritional_risk_imputed are now simple data-read bools. is_wic_at_nutritional_risk gates imputed risk on having a valid WIC category. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…data-read Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
These parameters are now exclusively in policyengine-us-data. No formula in the country package references them anymore since all takeup variables use default_value=True. Co-Authored-By: Claude Opus 4.6 <[email protected]>
MaxGhenis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All test suites pass. Codecov failures are non-blocking (Head Start takeup multiplication lines). Takeup parameters cleaned up — now exclusively in us-data.
- Add takes_up_ssi_if_eligible with default_value=True - Apply takeup multiplier in ssi.py for microsimulation - Follows new pattern from PR #7326 (no random() in country package) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add takes_up_ssi_if_eligible with default_value=True - Apply takeup multiplier in ssi.py for microsimulation - Follows new pattern from PR #7326 (no random() in country package) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add takes_up_ssi_if_eligible with default_value=True - Apply takeup multiplier in ssi.py for microsimulation - Follows new pattern from PR #7326 (no random() in country package) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add takes_up_ssi_if_eligible with default_value=True - Apply takeup multiplier in ssi.py for microsimulation - Follows new pattern from PR #7326 (no random() in country package) Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Add liquid asset variables for SSI modeling Adds three input variables imputed from SIPP in policyengine-us-data: - bank_account_assets: checking, savings, money market - stock_assets: stocks and mutual funds - bond_assets: bonds and government securities Updates ssi_countable_resources to calculate from these asset categories, enabling realistic asset-based eligibility testing for SSI. Co-Authored-By: Claude Opus 4.5 <[email protected]> * Use adds pattern for ssi_countable_resources Replace formula with adds attribute referencing parameter file that lists the asset sources. This separates policy logic (which assets count) from variable implementation. Co-Authored-By: Claude Opus 4.5 <[email protected]> * Fix references to use POMS sections that explicitly list countable resources The USC only lists exclusions, not what counts. POMS SI 01140.xxx explicitly defines bank accounts, stocks, and bonds as countable. Co-Authored-By: Claude Opus 4.5 <[email protected]> * Add spm_unit_cash_assets aggregation from person-level assets spm_unit_cash_assets now sums bank_account_assets, stock_assets, and bond_assets across the SPM unit. This flows through to IL AABD and MA EAEDC which use spm_unit_cash_assets. Co-Authored-By: Claude Opus 4.5 <[email protected]> * Use actual imputed assets for SSI resource test Remove microsimulation bypass that used random pass rate. Now that liquid assets are imputed from SIPP, the resource test can use real calculated values. - Remove pass_rate.yaml parameter (no longer needed) - Update README to reflect new methodology - meets_ssi_resource_test now always uses ssi_countable_resources Co-Authored-By: Claude Opus 4.5 <[email protected]> * Add SSI takeup variable and apply in benefit calculation - Add takes_up_ssi_if_eligible with default_value=True - Apply takeup multiplier in ssi.py for microsimulation - Follows new pattern from PR #7326 (no random() in country package) Co-Authored-By: Claude Opus 4.5 <[email protected]> * Trigger CI * Trigger CI * Add POMS references to asset variables Co-Authored-By: Claude Opus 4.5 <[email protected]> --------- Co-authored-by: Claude Opus 4.5 <[email protected]>
Summary
Supersedes #6635 and #7317. Fixes #7316.
Files changed
Deleted (3 seed variables)
Simplified (3 takeup variables - formula removed, default True)
Created (6 new files)
Rewritten (3 files - no more random())
Updated (4 files)
Test plan
Merge order
PolicyEngine/policyengine-us-data#451 must be merged FIRST, then this PR.
Related