Skip to content

UK: build area results on the routed local-area dataset when the executor takes policyengine.py 6.10.0 #880

Open

Description

@juaristi22

Part of #728.

PolicyEngine/policyengine.py#685, released as policyengine.py 6.10.0, makes the Microcosm national dataset the UK default. It routes constituency and local-authority regions to the Microcosm local-area dataset. The national file has no area codes, so a bare bump of the executor's pin breaks four things:

  • National and nation-level runs. They raise in _require_uk_area_column, so the UK comparisons and the deploy sentinel fail.
  • Image smokes. The executor and Stage 12 smokes read local-authority codes from the installed default, so image-smoke fails.
  • Stage 12. It plans constituency_code_oa and la_code_oa for every UK child, so national children fail.
  • Names. policyengine-api sends constituency/{name} and local_authority/{name}. The new registry is keyed by GSS code, so a name misses it and falls back to a weight-matrix region, and the bundle no longer has the matrices.

Work

  1. Build the constituency and local-authority breakdowns of national and nation-level runs from a second baseline and reform run on the routed dataset, with the same policies and nation filter. The national figures stay on the national file.
  2. Make both image smokes check the routed dataset when the installed default carries no area codes.
  3. Stop Stage 12 planning area columns for a routed national or nation-level report.
  4. Map area names and lower-case codes to the registry's GSS codes. The 17 districts replaced in April 2023 stay unsupported.

Each change applies only when uk_area_regions_routed() is true. It is false on policyengine.py 6.7.5, so the change can merge before the bump and does nothing until then.

Done when

The change has merged, and the executor behaves as before on policyengine.py 6.7.5. On 6.10.0, the touched tests and an end-to-end UK run with the private data pass.

🤖 Generated with Claude Code

Activity

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