-
-
Notifications
You must be signed in to change notification settings - Fork 8
Add OG-UK run script with PolicyEngine-UK compatibility fixes #60
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: main
Are you sure you want to change the base?
Add OG-UK run script with PolicyEngine-UK compatibility fixes #60
Conversation
- Add bracket-based tax function estimation to calibrate.py - New estimate_tax_functions_by_bracket() method - Filters micro data per bracket, estimates separately, replicates to ages - Supports custom brackets or auto-generated N equal brackets - Add age bracket utilities to get_micro_data.py - generate_age_brackets(): Auto-generate N equal brackets - create_custom_brackets(): Create from (min, max) tuples - filter_micro_data_by_age_bracket(): Filter data by age range - Updated DEFAULT_AGE_BRACKETS for UK (4 groups) - Update run_oguk_simple.py with configuration options - USE_AGE_BRACKETS toggle for bracket vs single function - N_BRACKETS for auto-generated brackets - CUSTOM_BRACKETS for UK-specific age ranges - Live timer showing elapsed time during computation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Reformat files with black (line length 79) - Bump version from 0.2.0 to 0.2.1 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Point to vahid-ahmadi/OG-Core@performance-optimizations - Includes loosened SS tolerances (mindist_SS: 1e-9→1e-3, RC_SS: 1e-8→1e-4) - Includes optional Numba JIT compilation for hot-path functions - ~55% faster steady state convergence 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
| "dask", | ||
| "distributed", | ||
| "ogcore", | ||
| "ogcore @ git+https://github.com/vahid-ahmadi/OG-Core.git@performance-optimizations", |
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.
Let's not change the package from ogcore on PyPI. We'll update OG-Core if needed.
| setuptools.setup( | ||
| name="oguk", | ||
| version="0.2.0", | ||
| version="0.2.1", |
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.
Let's bump to version 0.3.0 after these significant changes to link to the current PE-UK API.
|
@vahid-ahmadi Can you explain the age brackets? OG-Core allows for age specific (by year of age) and non-age specific (all ages face same tax functions). What is useful about the age brackets vs the separate functions by year of age? |
Summary
Updates OG-UK to work with the latest PolicyEngine-UK API and adds significant performance optimizations.
Key Changes
OG-Core Dependency
This PR depends on
vahid-ahmadi/OG-Core@performance-optimizationswhich includes:mindist_SS: 1e-9→1e-3,RC_SS: 1e-8→1e-4)Files Changed
oguk/calibrate.py- Updated for PolicyEngine-UK API, added bracket-based estimationoguk/get_micro_data.py- Added age bracket utilities and helper functionsexamples/run_oguk_simple.py- New configurable run script with live timersetup.py- Updated dependencies to use performance-optimized OG-CoreModel Parameters & Runtime Impact
tax_func_typestart_yearJage_bracketstime_pathAge Brackets Detail
Performance
Test Plan
🤖 Generated with Claude Code