Skip to content

Remove UK constituency map coordinates from impact responses #3823

Description

@anth-volk

Supersedes PolicyEngine/policyengine-uk#1152 together with PolicyEngine/policyengine-app-v2#1190.

Current behavior

The UK constituency comparison code reads statistical weights from the private UK data repository and reads constituency codes, names, and hex-layout coordinates from the public UK data repository. It calculates constituency impacts, then places frontend-specific x and y positions in each API result. The planned API v2 ConstituencyImpact persistence model also stores those positions.

Required change

  • Preserve constituency statistical aggregation and return the constituency identity, average household income change, and relative household income change without presentation coordinates.
  • Use a stable constituency identifier in the response contract so app-v2 can join results to its versioned layout.
  • Remove x and y from the applicable API response models, serializers, tests, OpenAPI contract, and API v2 constituency-impact persistence model.
  • Add the required v2 Alembic migration if the coordinate columns have already been created in a retained target.
  • Do not remove coordinates from a deployed response until Own the UK constituency hex-map layout in the frontend policyengine-app-v2#1190 has been deployed and verified.
  • Add contract coverage proving that constituency values and identities are preserved while layout positions are absent.

Deployment order

PolicyEngine/policyengine-app-v2#1190 is the compatibility prerequisite. Release the API contract change only after the frontend renders the same map from its own layout artifact.

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