GerryChain is a library for using Markov Chain Monte Carlo methods to study the problem of political redistricting. Development of the library began during the 2018 Voting Rights Data Institute (VRDI).
Using conda (recommended)¶
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 -n base conda conda init
For more information on using conda to install packages and manage dependencies, see Getting started with conda.
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
shapely. For this reason, we recommend installing
from conda-forge for most users.
- Getting started with GerryChain
- Running a chain with ReCom
- Working with Partitions
- What to do about islands and connectivity
maupto use a real-life plan in 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.