Phase 3: Expensive computations — API wiring#87
Merged
anth-volk merged 5 commits intoapp-v2-migrationfrom Feb 20, 2026
Merged
Conversation
Create congressional_district_impacts table and wire per-district income change computation into US economy comparison (local and Modal). Add congressional_district_impact field to EconomicImpactResponse. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds ConstituencyImpact DB model, Alembic migration, and wires constituency computation into both local and Modal UK economy comparison paths. Uses GCS-hosted weight matrix and constituency CSV. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds LocalAuthorityImpact DB model, Alembic migration, and wires computation into both local and Modal UK economy comparison paths. Uses GCS-hosted weight matrix and local authority CSV. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ne.py Migrate all intra-decile computation (UK+US, local+Modal) from the API's inline intra_decile.py helper to policyengine.py's new IntraDecileImpact output class. Add wealth decile impact and intra-wealth-decile impact for UK economy comparisons, using DecileImpact with decile_variable= "household_wealth_decile". Add decile_type column to intra_decile_impacts table to distinguish income vs wealth records. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extend fixtures with factory functions for congressional district, constituency, local authority, wealth decile, and intra-wealth-decile records. Add test classes verifying _build_response() populates all new fields correctly. 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
CongressionalDistrictImpactfrom policyengine.py for US economy comparisonConstituencyImpactandLocalAuthorityImpactfor UK economy comparisonapi/intra_decile.pyto policyengine.py'sIntraDecileImpactdecile_variable="household_wealth_decile")decile_typecolumn tointra_decile_impactstable (Alembic migration)wealth_decileandintra_wealth_decilefields toEconomicImpactResponseCompanion PR: PolicyEngine/policyengine.py#235 — Phase 3 output classes
Test plan
🤖 Generated with Claude Code