Skip to content
Use MCMC to analyze districting plans and gerrymanders
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Add workflows config version Feb 20, 2019
docs
gerrychain medium spacing May 13, 2019
tests Add slow_reversible_propose_bi to proposal test May 13, 2019
.gitattributes
.gitignore
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md Mar 22, 2019
CONTRIBUTING.md Rename everything to GerryChain Oct 9, 2018
LICENSE Use BSD 3-clause license Jan 21, 2019
MANIFEST.in Add MANIFEST.in again Apr 17, 2019
README.rst Fix typo Apr 17, 2019
readthedocs.yml Tell readthedocs to run setup.py install Oct 16, 2018
setup.cfg
setup.py Add scipy requirement May 9, 2019
versioneer.py add pytest-cov stuff and versioneer Jun 9, 2018

README.rst

GerryChain

Build Status Code Coverage Documentation Status PyPI Package conda-forge Package

GerryChain is a Python library for building ensembles of districting plans using Markov chain Monte Carlo. It is developed and maintained by the Metric Geometry and Gerrymandering Group and our network of volunteers. It is distributed under the 3-Clause BSD License.

The basic workflow is to start with the geometry of an initial plan and generate a large collection of sample plans for comparison. Usually, we will constrain these sampled plans in such a way that they perform at least as well as the initial plan according to traditional districting principles, such as population balance or compactness. Comparing the initial plan to the ensemble provides quantitative tools for measuring whether or not it is an outlier among the sampled plans.

Getting started

See our Getting started guide for the basics of using GerryChain.

We also highly recommend the resources prepared by Daryl R. DeFord of MGGG for the 2019 MIT IAP course Computational Approaches for Political Redistricting.

Useful links

Installation

Using conda (recommended)

To install GerryChain from conda-forge using conda, run

conda install -c conda-forge gerrychain

For this command to work as intended, you will first need to activate the conda environment that you want to install GerryChain in. If the environment you want to activate is called vrdi (for example), then you can do this by running

conda activate vrdi

If this command causes problems, make sure conda is up-to-date by running

conda update conda
conda init

For more information on using conda to install packages and manage dependencies, see Getting started with conda.

Using pip

To install GerryChain from PyPI, run pip install gerrychain from the command line.

This approach often fails due to compatibility issues between our different Python GIS dependencies, like geopandas, pyproj, fiona, and shapely. For this reason, we recommend installing from conda-forge for most users.

You can’t perform that action at this time.