-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UK - Constituency changes for next HoC general election #385
Conversation
…iamentary Constituencies Order 2023 the UK Gov introduced a lot of changes for the next general HoC election.
Readme added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still need to double check the set of districts, but providing some early feedback
I checked the count of OCD IDs after filtering out aliased IDs and districts which are being abolished and the total count yields 543 which maches the expected count after the 2023 redistricting. |
@jloutsenhizer Thanks for checking. |
I think we typically set validThrough to be one date before the new validFrom, to avoid having both old and new districts being considered valid on that day. |
@jpmckinney done |
I see a few dates like "The boundaries of X will..." "X will have its area reduced..." can we change these to pure dates? We can have an extra column if important to retain the sentences (not sure what to name the column). |
what would it look like if we changed it to pure dates as an example? |
You have some values like "2024-07-04: The boundaries of Berwick-upon-Tweed will change, and it will be renamed North Northumberland". I would just change them to "2024-07-04". We don't want the column empty if it is a new or abolished district. |
done |
Oh, my apologies, I misread the CSV and thought those values were in the validFrom/validThrough columns. They are fine in the sameAsNote column. You can reset to the previous commit and force push. How are you deciding which are "sameAs" and which are "boundaries changed and division renamed"? I think @chris48s @showerst @symroe had opinions on GB divisions when they were first added. |
done. reset to the previous version. we have decided this on the basis of the "Civics Common Standard Data Specification" here |
Hmm, reading that, I still don't know how are you deciding which to create aliases for, and which to make invalid / create new. Can you demonstrate with one example? |
You will have always sameAs if the boundaries AND the name is changed. Here is an overview over all current and new ocd's from our colleague with the official description of the changes |
Thanks! For the "Summary of change" column, where is that from? I checked the links in issue description, but it was not obvious. |
Sure: And inside the .xlsx the 2nd tab |
Ok, so looks like the logic is:
Regexes used:
|
# Remove validThrough from newcastle_upon_tyne_north (to get divisions with end dates down to 157) # unimportant differences in punctuation # keep the , (use CSV quoting) # ocd-division/country:gb/part:eng/region:ukc/ed:berwick-upon-tweed should not have a validFrom, since it is sameAs over time. # Montgomeryshire should either be abolished, or, if we follow the rename logic, be sameAs Montgomeryshire and Glyndwr, without the latter being "new" (though Montgomeryshire and Glyndwr also succeeds Clwyd South in the sheet, but thankfully Clwyd South itself is abolished – I haven't checked if any others do this).
@jpmckinney all done. |
Is there any way we can track down the difference? We should have 650 valid divisions both before 2024-07-03 and after 2024-07-04 (not including sameAs). Also, I intended only the punctuation in the "Ayr, Carrick and Cumnock" list to be updated. I only noted the others to assist me when comparing names before (which had more commas) and after (which had fewer). |
FWIW, this is why I write Python or Ruby scripts for Canada. If we can download the XLSX and then write code to update constituencies, then it's much easier to verify and make changes as needed. Right now, it's all quite hard to verify. |
@jpmckinney i made an update. And in the end we have again 650 constituencies. fyi: i found trough the script the two entries, whre walidFrom was set but there was also a sameAs reference for this entry. |
@jpmckinney friendly ping, as the election is not far away |
Thank you! I typically commit the script as well under |
@jpmckinney hehe, maybe next time. I wrote the script with js and html output and really dirty with the sources as .csv files. But can anybody merge the pull request now? |
After the 2023 Periodic Review of Westminster constituencies the Parliamentary Constituencies Order 2023 the UK Gov introduced a lot of changes for the next general HoC election.
Including:
211 newly named constituencies (lost of redistricting)
Many abolished constituency names
Some disappearing and newly created seats
See Wiki for Summary and link below for law with table that lists new constituencies (pdf).
https://en.wikipedia.org/wiki/2023_Periodic_Review_of_Westminster_constituencies#New_and_abolished_constituencies
https://www.legislation.gov.uk/uksi/2023/1230/pdfs/uksi_20231230_en.pdf
More background:
https://commonslibrary.parliament.uk/constituency-boundary-review-data-for-new-constituencies/
Readme will follow. Due to the recent unexpected election (by date), i wanted to share the constituency changes first