[v4] Unify ProgramStatistics / ProgrammeStatistics#293
Open
MaxGhenis wants to merge 1 commit intov4-provenancefrom
Open
[v4] Unify ProgramStatistics / ProgrammeStatistics#293MaxGhenis wants to merge 1 commit intov4-provenancefrom
MaxGhenis wants to merge 1 commit intov4-provenancefrom
Conversation
Two byte-identical classes split only by British/American spelling (program_name vs programme_name). Collapsed into a single policyengine.outputs.ProgramStatistics; both country analysis helpers import it from there now. Saves ~106 LOC of duplication and removes an API-surface footgun for cross-country code. Changes: - Add policyengine/outputs/program_statistics.py with the unified class. - Re-export from policyengine/outputs/__init__.py. - Delete tax_benefit_models/us/outputs.py and tax_benefit_models/uk/outputs.py. - us/__init__.py and uk/__init__.py re-export from policyengine.outputs. - uk/analysis.py: rename programme_name -> program_name, programme_statistics -> program_statistics, programmes -> programs, programme_df/collection -> program_df/collection. Field on PolicyReformAnalysis also changes. Migration for callers: - from policyengine.tax_benefit_models.uk import ProgrammeStatistics -> from policyengine.outputs import ProgramStatistics - stats.programme_name -> stats.program_name 205 tests pass locally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
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.
Stacked on #292. Fifth in the v4 chain. Straight deduplication.
What
Two byte-identical classes — `ProgramStatistics` (US) and `ProgrammeStatistics` (UK) — collapse into one `policyengine.outputs.ProgramStatistics`. The British/American spelling split was accidental divergence, not editorial choice, and it was visible at the public API level.
Migration
```python
Before
from policyengine.tax_benefit_models.uk import ProgrammeStatistics
stats.programme_name
After
from policyengine.outputs import ProgramStatistics # or from .uk
stats.program_name
```
Test plan
Remaining in v4
🤖 Generated with Claude Code