GerryChain
GerryChain copied to clipboard
Use MCMC to analyze districting plans and gerrymanders
The `node_repeats` parameter of `bipartition_tree_random` is documented as `A parameter for the algorithm: how many different choices of root to use before drawing a new spanning tree.`. However, in fact...
This is a PR to add some shims to alternate implementation/sampling methods. These shims can be called from GerryChain Python and behave as a drop-in replacement for normal chain running....
This is a draft PR (based off `perf-tuning` that rewrites the balance edge picking algorithm in Rust using `retworkx`, yielding a ~16x speedup in chain run times). PA chain run...
Updating locality_split_scores.py with split pairs metric (see this [github repo](https://github.com/jacobwachspress/locality-splitting) and [paper](https://cdt.org/wp-content/uploads/2021/11/2021-11-04-Locality-splitting-report-final.pdf) for more details). By the way, is locality_split_scores.py outdated? It looks like there is only support for CountySplit...
`gerrychain.random` sets a default random seed (`2018`) globally: https://github.com/mggg/GerryChain/blob/198f43dae397a7e361dcaa059a7ac8a4e0ff18f3/gerrychain/random.py#L5 This is bad—for starters, the state of other packages could be affected without users immediately noticing.
Graph raises the following deprecation warning when assigning ids to geometries for purposes of calculating adjacency: ``` ... /gerrychain/graph/adjacency.py:21: ShapelyDeprecationWarning: Setting custom attributes on geometry objects is deprecated, and will...
Because we are often interested in contour-based compactness scores (e.g. Polsby-Popper, Reock, Convex Hull, etc.), this implements the `EmbeddedGraph` class where each networkx node stores information about the (multi)polygon to...