Skip to content

Drop x and y from the UK area lists and from constituency and local-authority results #726

Closed

Description

@anth-volk

Current behaviour

.py's packaged UK area lists, src/policyengine/data/uk_geography/constituencies_2024.csv and local_authorities_2023.csv, have x and y columns: each area's integer position on a hex map. compute_longwise_uk_geography_impacts copies them into every result row of compute_uk_constituency_impacts, compute_uk_local_authority_impacts, ConstituencyImpact and LocalAuthorityImpact, as "x" and "y" (None for codes the lookup does not list).

Why remove them

The PolicyEngine app (PolicyEngine/policyengine-app-v2) now places constituencies and local authorities on its hex maps from its own layout files, so nothing downstream should depend on .py's positions. A second copy of the layout in .py can drift from the app's.

Intended result

  • constituencies_2024.csv has the columns code,name,region,country, and local_authorities_2023.csv has code,name. The rows, codes, names and order are unchanged.
  • Constituency and local-authority result rows have no x or y keys. A lookup CSV passed as constituency_csv_path or local_authority_csv_path may still have x and y columns; they are ignored.
  • SOURCES.md, the two functions' docstrings and the docs no longer describe hex positions.

Merge order

The simulation API's executor reads x and y from .py's constituency list and refuses result rows without them until PolicyEngine/policyengine-sim-api#919 is deployed, so the change must merge only after that deployment. It also waits until after the UK Budget on 28 October 2026.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions