Add OG-UK run script with PolicyEngine-UK compatibility fixes#60
Open
vahid-ahmadi wants to merge 6 commits intoPSLmodels:mainfrom
Open
Add OG-UK run script with PolicyEngine-UK compatibility fixes#60vahid-ahmadi wants to merge 6 commits intoPSLmodels:mainfrom
vahid-ahmadi wants to merge 6 commits intoPSLmodels:mainfrom
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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
jdebacker
reviewed
Dec 19, 2025
setup.py
Outdated
| "dask", | ||
| "distributed", | ||
| "ogcore", | ||
| "ogcore @ git+https://github.com/vahid-ahmadi/OG-Core.git@performance-optimizations", |
Member
There was a problem hiding this comment.
Let's not change the package from ogcore on PyPI. We'll update OG-Core if needed.
jdebacker
reviewed
Dec 19, 2025
setup.py
Outdated
| setuptools.setup( | ||
| name="oguk", | ||
| version="0.2.0", | ||
| version="0.2.1", |
Member
There was a problem hiding this comment.
Let's bump to version 0.3.0 after these significant changes to link to the current PE-UK API.
Member
|
@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? |
Addresses @jdebacker's review comment to use 0.3.0 instead of 0.2.1 given the significant changes to the PolicyEngine-UK API integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Addresses @jdebacker's review comment to keep using ogcore from PyPI instead of pointing to a fork branch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
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