mysociety / theyworkforyou

Keeping tabs on the UK's parliaments and assemblies
http://www.theyworkforyou.com/
Other
224 stars 50 forks source link

Add new boundaries #1802

Closed ajparsons closed 6 hours ago

ajparsons commented 1 week ago

New boundaries need to be loaded into TWFY to be referenced.

Assuming we'll do the 'just create new constituencies' approach.

Boundaries are stored under 'posts' and look like this:

{
  "area": {
    "name": "Croydon South"
  },
  "id": "uk.org.publicwhip/cons/159",
  "identifiers": [
    {
      "identifier": "1994",
      "scheme": "historichansard_id"
    }
  ],
  "label": "Member of Parliament for Croydon South",
  "organization_id": "house-of-commons",
  "role": "Member of Parliament",
  "start_date": "1955"
}

Considerations

  1. There are 65 constituencies) with no changes to their boundaries.
  2. There are 418 constituencies that share a name with an old constituency (where it has been lightly changed or forms the core of the new constituency).
  3. We don't currently store GSS codes - GSS codes are part of the Democracy Club output.
  4. There has been an inconsistent approach to updating GSS codes. ONS has created new codes even for constituencies with new changes (e.g. Epping forest was 'E14000693', now 'E14001226',) while constituencies without a change in Scotland have retained the same code(North Ayrshire and Arran remains 'S14000048').

Approaches

Update existing ones

Just create new constituencies

e.g.

{
  "area": {
    "name": "Croydon South"
  },
  "id": "uk.org.publicwhip/cons/XXX",
  "identifiers": [
    {
      "identifier": "uk.org.mysociety.cons.ukparl.2025.crs",
      "scheme": "mysoc_full_code"
    },
    {
      "identifier": "UKPARL.2025.CRS",
      "scheme": "mysoc_short_code"
    },
    {
      "identifier": "E14001187",
      "scheme": "gss"
    },
    {
      "identifier": "CRS",
      "scheme": "three_code"
    }
  ],
  "label": "Member of Parliament for Croydon South",
  "organization_id": "house-of-commons",
  "role": "Member of Parliament",
  "start_date": "2024-07-04"
}

Questions

dracos commented 6 days ago

More annoyingly, we appear to have two lists of constituencies, in people.json and constituencies.json - constituencies.json is what is currently loaded into TWFY; the member loading uses the constituencies in people.json to get the constituency name, sigh.

ajparsons commented 2 days ago

Will be addressed by https://github.com/mysociety/theyworkforyou/pull/1803 and https://github.com/mysociety/parlparse/pull/173