Skip to content

Add the six April 2023 unitary authorities to LocalAuthority - #1870

Merged
juaristi22 merged 2 commits into
mainfrom
local-authority-2023-unitaries
Sep 22, 2026
Merged

juaristi22 merged 2 commits into
mainfrom
local-authority-2023-unitaries

Conversation

@juaristi22

Copy link
Copy Markdown
Collaborator

Adds the six April 2023 unitary authorities to LocalAuthority: Cumberland (E06000063), North Northamptonshire (E06000061), North Yorkshire (E06000065), Somerset (E06000066), West Northamptonshire (E06000062) and Westmorland and Furness (E06000064).

They are the only April 2023 local authority district codes with no member, so a dataset on that roster cannot supply local_authority for their households (about 1.4 million people) and they fall to the MAIDSTONE default. Microcosm assigns an authority per household row and is about to supply the input (PolicyEngine/microcosm#953); the ask was first raised in the review of #1855, whose amounts.yaml can then carry Band D for these six as well.

Members are inserted in the enum's existing display-name order; every predecessor district stays a valid member. policyengine_uk/tests/policy/baseline/gov/local_authorities passes (36 tests).

🤖 Generated with Claude Code

Cumberland, North Northamptonshire, North Yorkshire, Somerset, West
Northamptonshire and Westmorland and Furness are the April 2023 local
authority districts absent from the enum, so a dataset on that roster
could not supply local_authority for their households (about 1.4 million
people fell to the MAIDSTONE default). Members are inserted in the enum's
display-name order; every predecessor district stays a valid member.

Requested on #1855; consumed by
PolicyEngine/microcosm#953.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@juaristi22

Copy link
Copy Markdown
Collaborator Author

Adversarial review — one small required fix

Reviewed 52f42818465d2b34375d9780e222647c4e33d9db against merge base a16193acc4e4e8bfdac945a10e457dc2473015fd. Review complete: one P2 release-process finding; no model correctness issues found.

C1 / P2 — Give the changelog fragment a configured Towncrier type

changelog.d/local-authority-2023-unitaries.md:1 lacks a configured type. The repository requires <slug>.<type>.md, and its main-branch versioning job runs bump_version.py followed by towncrier build.

Running installed Towncrier 26.9.0 against this exact snapshot with build --draft returns “No significant changes”; its filename parser returns (None, None, None). The repository's version inference returns patch. Consequently this change receives no generated release note and does not receive an added fragment's intended minor bump.

Fix: rename the fragment to local-authority-2023-unitaries.added.md. This is a required release-process correction, not a council-tax calculation defect or a demonstrated publishing failure. I recommend making this rename before merging.

Validation

  • 56 targeted tests passed: 15 Python tests (12 existing tests plus three review diagnostics) and 41 existing policy YAML tests. The diagnostics cover all six new authorities across 12 working-age/pensioner household scenarios, including positive pensioner Council Tax Reduction, and an actual H5 save/reload round trip. An initial YAML harness setup error was corrected; only the 41 affected tests were rerun, and all passed.
  • All six CI checks passed at the reviewed head. The workflow run explicitly records the same SHA.
  • All six authority names and ONS codes match the official April 2021 and April 2023 rosters. North and West Northamptonshire were formed in 2021; the April 2023 roster wording is not treated as a policy defect.
  • Gross Council Tax is a household input at this head, so these enum additions do not require new rate-table entries. Existing Council Tax Reduction routes handle the new authorities.
  • The supported H5 writer stores enum names, including after in-memory int16 encoding. Reloading preserved all six new names and four existing names; inserting members alphabetically did not corrupt persisted values on this path.

No material evidence gaps remain in the reviewed scope. No dependencies were installed, source files changed, or population data downloaded. Review performed with Codex and the PolicyEngine review-program workflow.

Review C1: a typeless fragment yields no release note and no minor bump;
the repository requires <slug>.<type>.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@juaristi22

Copy link
Copy Markdown
Collaborator Author

C1 addressed in c0f089f: the fragment is now changelog.d/local-authority-2023-unitaries.added.md, so Towncrier picks it up as an Added note and the versioning job infers a minor bump. No other change.

@juaristi22
juaristi22 merged commit e651df3 into main Sep 22, 2026
6 checks passed
@juaristi22
juaristi22 deleted the local-authority-2023-unitaries branch September 22, 2026 15:30

@vahid-ahmadi vahid-ahmadi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review at c0f089f4 (worktree checkout; CI green).

Checked first-hand:

  • Pulled the ONS April 2023 LAD roster (361 rows) and matched every LAD23NM against the enum's display names: zero missing after this PR, so the six really are the only gaps. Codes match (E06000061 N Northants, E06000062 W Northants, E06000063 Cumberland, E06000064 Westmorland and Furness, E06000065 N Yorkshire, E06000066 Somerset).
  • policyengine-core test .../gov/local_authorities: 36 passed.
  • Encode/decode round trip on the new member names goes through Enum.encode by name, and the H5 path stores names, so inserting members mid-list (which shifts ~300 int16 indices) is safe for the supported dataset format. Anything that persisted raw enum indices would remap silently, but nothing in this repo does.
  • Only other LocalAuthority consumer is the CTR scheme config.py, which compares against five specific members; unaffected.
  • The Towncrier rename from the Codex round is in place (.added.md).

One nit on the body: "about 1.4 million people" for the six authorities. ONS mid-2023 estimates for the six sum to roughly 2.5 million (North Yorkshire ~0.62m and Somerset ~0.58m alone are 1.2m). If 1.4m is the dataset-weighted count of households currently falling to the MAIDSTONE default, say so; otherwise correct it.

Approving.

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.

2 participants