Conversation
* Implements partial districts variant * Adds another test (for the case where COI size > district size) * Refines documentation
InnovativeInventor
approved these changes
Dec 10, 2021
InnovativeInventor
left a comment
Member
There was a problem hiding this comment.
Looks good to me. Not sure if the numpy stuff is entirely needed, though (pandas may be sufficient for this).
2d37a71 to
1f9de6b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a more polished version of the COI preservation calculations over in coi-states to the evaluation suite.
TODO
Usage
The COI preservation updater assumes that COIs (or COI aggregations, a.k.a. geoclusters) and dual graph units can be (approximately) represented with a common block unit. Typically, this common unit is the 2020 U.S. Census block. Updaters are specialized to a particular set of COIs and a particular dual graph.
Example: preservation of Wisconsin geoclusters
Suppose
wisconsin_clusters.csvis a table of geoclusters generated by the pipeline in coi-states. We can load 2020 Census block approximations of the geoclusters as follows:(To compute the preservation of individual COI submissions instead of geoclusters, simply swap in a submission-level dataset with a
blocks_2020column.)An exact correspondence between 2020 Census blocks and 2020 Census VTDs can similarly be loaded from the official Census block assignment files (BAFs). We expect that the same node identifier is used in the dual graph and in the VTD-block calculations, so it may be necessary to map between Census GeoIDs and node indices.
Block total populations (
P1_001N) can be retrieved via the Census API.Then, we can generate a COI preservation updater over a range of preservation thresholds: