Phase 3: Expensive computations — output classes#235
Merged
anth-volk merged 6 commits intoapp-v2-migrationfrom Feb 20, 2026
Merged
Phase 3: Expensive computations — output classes#235anth-volk merged 6 commits intoapp-v2-migrationfrom
anth-volk merged 6 commits intoapp-v2-migrationfrom
Conversation
Add CongressionalDistrictImpact output that groups households by congressional_district_geoid and computes per-district weighted average and relative income changes. Add geoid to US household entity_variables. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds ConstituencyImpact output that reweights households using a pre-computed weight matrix (parliamentary_constituency_weights.h5) to compute per-constituency average/relative income change. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds LocalAuthorityImpact output that reweights households using a pre-computed weight matrix (local_authority_weights.h5) to compute per-local-authority average/relative income change. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add IntraDecileImpact output class with compute_intra_decile_impacts() for computing 5-category income change distributions within deciles. Uses qcut by default for grouping, with decile_variable parameter for pre-computed groupings (e.g. household_wealth_decile). Also adds decile_variable parameter to DecileImpact for the same purpose, and adds household_wealth_decile to UK entity_variables. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add tests for CongressionalDistrictImpact, ConstituencyImpact, LocalAuthorityImpact, IntraDecileImpact, and DecileImpact with decile_variable support. Use model_construct() in convenience functions to bypass Pydantic validation for programmatic construction. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 tasks
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
CongressionalDistrictImpactoutput class for US per-district income changesConstituencyImpactoutput class for UK parliamentary constituencies (weight matrix reweighting)LocalAuthorityImpactoutput class for UK local authorities (weight matrix reweighting)IntraDecileImpactoutput class with 5-category income change proportions (people-weighted)decile_variableparameter toDecileImpactfor pre-computed grouping (wealth deciles)household_wealth_decileto UK model entity variablesCompanion PR: PolicyEngine/policyengine-api-v2-alpha#87 — Phase 3 API wiring
Test plan
🤖 Generated with Claude Code