You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
economic_impact_analysis() in both us/analysis.py and uk/analysis.py is broken and untested. The API (policyengine-api-v2-alpha) bypasses it entirely, reimplementing all orchestration in computation_modules.py (818 lines) with workarounds for library bugs.
What's broken today
Issue
Detail
Wrong US program names
payroll_tax → employee_payroll_tax, state_income_tax not a program
Wrong US entity for ssi
Uses person, should be spm_unit
Too many US programs
11 programs; API only uses 6 that work
Missing model_rebuild()
ProgrammeStatistics (UK) never rebuilt
calculate_decile_impacts() creates new sims
Wasteful when caller already has run simulations
No intra-decile computation
API computes this; library skips it
No budget summary
No class exists; API has workaround for double-weighting
No poverty by demographics
API computes age/gender/race breakdowns; library skips them
StopIteration on missing variables
Crashes instead of clear error
Solution
Add CountryConfig strategy class with US_CONFIG/UK_CONFIG — eliminates country conditionals
Add compute_budget_summary(), compute_decile_impacts(), compute_program_statistics() as individual functions
Add PolicyReformAnalysis unified result container
Rewrite economic_impact_analysis() for both countries to use individual compute functions
Fix model_rebuild() in both __init__.py files
Fix error handling in Aggregate/ChangeAggregate (StopIteration → ValueError)
This is Phase 1 of consolidating logic from policyengine-api-v2-alpha back into policyengine.py.
intra-decile income changes: outputs/intra_decile_impact.py, wired into both countries' economic_impact_analysis
poverty demographics: outputs/poverty.py (calculate_us_poverty_by_age/gender/race, UK age/gender)
The remaining ask is the dedicated budget summary. #359's expanded program-statistics rows (fuel duty, state pension, employer NI, tax credits, plus the tax/benefit totals) may already cover the underlying need — suggest either trimming this issue to just "per-variable budget summary output, if a consumer asks for it" or closing it in favor of the program-statistics rows.
Closing as completed. Economic-impact analysis now includes validated program mappings, demographic poverty results, intra-decile results, and federal, state, and unattributed budget totals.
Activity
feat: Fix economic_impact_analysis with correct programs, budget summ…
feat: Fix economic_impact_analysis with correct programs, budget summ…
MaxGhenis commentedon Jul 7, 2026
Status check against main (2026-07-08 review): three of this issue's four asks have merged —
outputs/intra_decile_impact.py, wired into both countries'economic_impact_analysisoutputs/poverty.py(calculate_us_poverty_by_age/gender/race, UK age/gender)The remaining ask is the dedicated budget summary. #359's expanded program-statistics rows (fuel duty, state pension, employer NI, tax credits, plus the tax/benefit totals) may already cover the underlying need — suggest either trimming this issue to just "per-variable budget summary output, if a consumer asks for it" or closing it in favor of the program-statistics rows.
anth-volk commentedon Aug 31, 2026
Closing as completed. Economic-impact analysis now includes validated program mappings, demographic poverty results, intra-decile results, and federal, state, and unattributed budget totals.