-
Notifications
You must be signed in to change notification settings - Fork 196
Extend uprating factors through 2100 #6384
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
base: master
Are you sure you want to change the base?
Conversation
Extended all uprating factors through year 2100 using the growth rate from the final year of existing projections. This enables long-term policy simulations and fiscal projections. Changes: - IRS uprating extended using 2034-2035 growth rate - SNAP uprating extended using 2033-2034 growth rate (2.246% annual) - CPI-U extended using 2034-2035 growth rate (2.336% annual) - Chained CPI-U extended using 2034-2035 growth rate (1.988% annual) - CPI-W extended using approximately 2.3% annual growth rate Fixes PolicyEngine#6383 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Added comprehensive tests to verify that all uprating factors (IRS, SNAP, CPI-U, Chained CPI-U, CPI-W) correctly extend through year 2100 with consistent growth rates. Tests verify: - Values exist for year 2100 - Growth rates are consistent after the projection period - Growth rates are within reasonable bounds (1-4% annually) - Values in 2100 are appropriately higher than 2035 values 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Moved uprating tests to appropriate directories under tests/policy/baseline/gov/ to ensure they are picked up by the CI selective test runner: - IRS uprating test → gov/irs/parameters/ - SNAP uprating test → gov/usda/snap/ - CPI uprating tests → gov/bls/ This ensures the tests will run when the corresponding parameter files are changed. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Refactored all uprating tests to be more resilient to future changes: - Test properties (monotonic increase, consistent growth) rather than specific values - Use wider growth rate bounds (0.5% - 5%) to avoid false failures - Test that values exist for 2100 without hardcoding expected values - Focus on verifying the extension logic works correctly This makes the tests maintainable when we update the base uprating values in the future - tests will continue to pass as long as the fundamental properties (extension to 2100, consistent growth) are maintained. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Added underscore thousands separators to all values >= 1000 in: - SNAP uprating (values from 2077 onward) - CPI-U (values from 2075 onward) - CPI-W (values from 2080 onward) This improves readability following PolicyEngine conventions. Chained CPI-U values don't exceed 1000 by 2100 so no changes needed there. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Extended SSA uprating through 2100 using 2.26% annual growth rate - Extended HHS poverty line uprating through 2100 using 2.24% annual growth - Updated SSA 2025 value to reflect actual 2.5% COLA announced by SSA - Added thousands separators to all values >= 1000 for readability This completes the extension of all major uprating factors (IRS, SNAP, SSA, HHS, CPI) through year 2100 to support long-term policy simulations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
policyengine_us/tests/policy/baseline/gov/bls/test_cpi_uprating_2100.py
Outdated
Show resolved
Hide resolved
policyengine_us/tests/policy/baseline/gov/bls/test_cpi_uprating_2100.py
Outdated
Show resolved
Hide resolved
- Created unified uprating extension script for all parameters - Removed hardcoded future values from YAML files - Updated tests to use microsimulation approach - Removed unnecessary if statements in test code - Cleaned up changelog entry - Filed issue for moving this functionality to policyengine-core
CI check requested after addressing review comments. |
- Extended CPI-U, Chained CPI-U, and CPI-W through 2100 programmatically - Removed hardcoded future values from CPI YAML files - Created single comprehensive test for all uprating extensions - Removed redundant individual uprating test files
Latest changes:
All tests pass locally. Waiting for CI to trigger. |
Verification of Programmatic Uprating ValuesI've created a Jupyter notebook to verify that the programmatically generated uprating values compare with the previously hardcoded values: 📓 View the verification notebook Key Findings:The programmatic approach generates values that are very close to the hardcoded ones, with some expected differences:
These differences arise because:
The programmatic approach is more maintainable and consistent, ensuring:
The small differences from hardcoded values are acceptable given the improved maintainability and consistency of the new approach. |
- Kept upstream HHS uprating references (more complete) - Accepted upstream uv.lock - Maintained programmatic uprating extensions
✅ CI Passed!All checks have passed after merging with upstream master:
The PR is ready for review. The unified programmatic uprating approach is working correctly for all parameters (IRS, SNAP, SSA, HHS, CPI-U, Chained CPI-U, and CPI-W). |
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.
nits
changed: | ||
- Updated SSA 2025 value to reflect actual 2.5% COLA announced by SSA | ||
- Refactored all uprating extensions from hardcoded YAML values to programmatic generation | ||
- Consolidated individual uprating tests into a single comprehensive test file |
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.
Again nit but I dont think we should include this in the changelog. It seems like we are adding commit changes, this will make looking back through the changelog harder
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.
Should this live in parameters? I know the old .py file was also stored there but we should probably separate it out from actual policy parameters
Summary
Changes
policyengine_us/parameters/gov/irs/uprating.py
policyengine_us/parameters/gov/usda/snap/uprating.yaml
policyengine_us/parameters/gov/bls/cpi/cpi_u.yaml
policyengine_us/parameters/gov/bls/cpi/c_cpi_u.yaml
policyengine_us/parameters/gov/bls/cpi/cpi_w.yaml
Implementation Details
For each uprating factor, I calculated the growth rate from the last two years of existing projections and applied that constant rate forward through 2100. This approach ensures smooth continuation of trends without arbitrary assumptions about future economic conditions.
Test Plan
make format
to ensure code style complianceFixes #6383
🤖 Generated with Claude Code