Skip to main content

Use Markov chain Monte Carlo to analyze districting plans and gerrymanders

Project description

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.

Installation

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gerrychain-0.2.18.tar.gz (61.1 kB view hashes)

Uploaded Source

Built Distributions

gerrychain-0.2.18-py3.8.egg (129.4 kB view hashes)

Uploaded Source

gerrychain-0.2.18-py2.py3-none-any.whl (55.0 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page