-
Notifications
You must be signed in to change notification settings - Fork 15
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
Dealing with Community Governance Reviews #570
Comments
To make this process slightly easier, there is now a management command that will try to assign the divisions of ballots in an election group to a given divisionset: EveryElection/every_election/apps/elections/management/commands/assign_election_to_divisionset.py Lines 1 to 83 in f773d74
You can use this instead of running the ad-hoc script in the code block above. It can take one or more election_ids. example: |
Local authorities may sometimes make minor 'technical' boundary changes in a Community Governance Review. These are problematic because they result in boundary changes defined in an Electoral Changes Order, but because the reviews are conducted at local level (without LGBCE's involvement), there is no provisional boundary set available before the first election using the new boundaries and none of our existing tooling for dealing with boundary reviews applies. An ECO resulting from a CGR will never change the number of wards or the number of councillors representing each ward, but they do change the internal boundaries.
This usually means we have to run the first election using the old (incorrect) boundaries, accepting that this means there will be some users who we're assigning to the wrong ward. Then we have to retrospectively import the new boundaries once the May BoundaryLine release is issued.
Within that structure, there are 2 distinct cases:
The first of those two cases is easiest to deal with - it doesn't really need any special handling. Because no real election has ever been held using the provisional boundaries (LGBCE's final recommendations prior to the amendment order), there's no need to retain a record of them. We can run our usual process for back-porting codes/boundaries from BoundaryLine over provisional boundaries from LGBCE. The provisional boundaries will be overwritten. The elections we already ran using the provisional boundaries will now be attached to the correct ones and we'll use the right boundaries moving forwards.
The second case is more complicated. Because we've already run some elections using the old boundaries, we need to create a new
DivisionSet
for the revised boundaries and retrospectively edit the most recent elections to attach them to the boundaries in the latestDivisionSet
.The process I'm currently following to achieve that is:
DivisionSet
in/admin
DivisionSet
in/admin
DivisionSet
to the new one using thecopy_divisions
management commanddivision_id
anddivision_geography_id
to the corresponding ones from the newDivisionSet
. Do this step while you've still got the old GSS codes attached to the new divisions because then you can match everything up on GSS./admin
on theDivision
s in the newDivisionSet
boundaryline_import_boundaries
management command to overwrite the old boundary with the new one for each new GSS code.So, to work the Newark & Sherwood example through:
Started off by setting the end date on DivSet 279 to 01/05/2019 (one day before
local.newark-and-sherwood.2019-05-02
)Created a new DivSet 593 with a start date of 02/05/2019
Ran
python manage.py copy_divisions 279 593
to copy all the divisions from the old DivSet to the new one.At this point, I still had all the ballot objects under
local.newark-and-sherwood.2019-05-02
attached to the divisions in DivSet 279, so while the divisions in DivSet 593 still had the same GSS codes on them, I ranas an ad-hoc task to switch the
division_id
anddivision_geography_id
s on the child ballots oflocal.newark-and-sherwood.2019-05-02
to reference the divisions in DivSet 593.The 2016 Electoral Change Order defines boundary changes to the following 4 wards:
So the next step was to find the new GSS codes for those 4 wards from BoundaryLine and update the
Division
records to use the new codes:All the other wards didn't have any changes, so they retained the same GSS codes.
Finally once the
Divisions
in the new Divset 593 had the updated GSS codes on them, I made a JSON fileand ran
manage.py boundaryline_import_boundaries --source "bdline_gb-2019-05b" --codes "codes.json" -f "/path/to/bdline_gb-2019-05b"
to overwrite the old boundaries with the new ones.The end result of that is that:
So.. what was the point of this issue?
Several reasons:
DivisionSet
, would it be better to produce tooling to create a newDivisionSet
using BoundaryLine as a base and then deal with editing thedivision_id
anddivision_geography_id
s on the old election objects using a map of old GSS codes --> new GSS codes?The text was updated successfully, but these errors were encountered: