-
Notifications
You must be signed in to change notification settings - Fork 35
Add UK local authorities #2992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UK local authorities #2992
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
This PR successfully adds UK local authority breakdown support to the API, mirroring the existing constituency breakdown feature. The implementation is solid and well-tested.
What this adds:
- New
local_authorityregion type in constants - 360 local authorities across England, Scotland, Wales, and Northern Ireland
uk_local_authority_breakdown()function that calculates income impacts by local authority- Filtering support for specific local authorities and countries
- Comprehensive unit tests with good coverage
Code Quality:
- Follows existing patterns from constituency breakdown
- Proper separation of concerns with Pydantic models
- Good test coverage including edge cases
- No syntax errors
Minor observations (non-blocking):
- The local authority filtering uses
code.startswith()(compare.py:737-746) which is more accurate than the constituency code's"E" in codepattern (compare.py:626, 652), but both approaches work correctly for the actual UK region codes - Consistent pattern of mutual exclusion: constituency regions skip LA breakdown, LA regions skip constituency breakdown
The implementation correctly handles all the required functionality and integrates cleanly with the existing codebase.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2992 +/- ##
==========================================
- Coverage 74.87% 70.25% -4.63%
==========================================
Files 54 55 +1
Lines 2026 2353 +327
Branches 268 333 +65
==========================================
+ Hits 1517 1653 +136
- Misses 459 639 +180
- Partials 50 61 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixes #2989
Should be merged alongside a corresponding front-end PR in app v2 (not yet created)
@PolicyEngine write up a description of this PR