Skip to content

[codex] Add opt-in cliff impact outputs#377

Merged
anth-volk merged 4 commits into
mainfrom
codex/cliff-impact
May 28, 2026
Merged

[codex] Add opt-in cliff impact outputs#377
anth-volk merged 4 commits into
mainfrom
codex/cliff-impact

Conversation

@anth-volk
Copy link
Copy Markdown
Contributor

Closes #376

Summary

  • add a public cliff impact output API matching the legacy simulation API response shape
  • materialize cliff_gap, is_on_cliff, and is_adult only when cliff impacts are requested
  • wire include_cliff_impacts into US and UK reform analyses
  • extract shared extra-variable plumbing used by cliff impacts and labor supply response

Validation

  • ruff check src/policyengine/outputs/cliff_impact.py src/policyengine/outputs/extra_variables.py src/policyengine/outputs/labor_supply_response.py src/policyengine/tax_benefit_models/us/analysis.py src/policyengine/tax_benefit_models/uk/analysis.py tests/test_cliff_impact.py tests/test_cliff_impact_analysis.py
  • pytest tests/test_cliff_impact.py tests/test_cliff_impact_analysis.py
  • pytest tests/test_labor_supply_response.py tests/test_uk_analysis.py tests/test_uk_program_statistics.py

Local parity note

I also ran an ignored local parity harness against the legacy simulation API with pinned package/data versions. The nonzero sampled cliff case matched exactly:

  • cliff_gap: 3,952,908,577.8710938
  • cliff_share: 0.0060240964024626835

The parity harness is intentionally not included in this PR because the cliff calculation is slow.

@anth-volk anth-volk marked this pull request as ready for review May 27, 2026 17:09
@anth-volk anth-volk requested a review from vahid-ahmadi May 27, 2026 17:10
@anth-volk anth-volk merged commit fa986de into main May 28, 2026
11 checks passed
@anth-volk anth-volk deleted the codex/cliff-impact branch May 28, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add opt-in cliff impact outputs to reform analyses

1 participant