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 details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Egg

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

Uploaded Python 2Python 3

File details

Details for the file gerrychain-0.2.18.tar.gz.

File metadata

  • Download URL: gerrychain-0.2.18.tar.gz
  • Upload date:
  • Size: 61.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for gerrychain-0.2.18.tar.gz
Algorithm Hash digest
SHA256 7879e518b028536f0e6add7809e5980bce2eb409d3fb54c7cbe1d067cfbac7ca
MD5 f4b97a795e3e655311eb5b1c7646b350
BLAKE2b-256 a8d9ffc92552dd07b3dbc8bf7a70e119f073a20f93547933e4227b18b6ac0581

See more details on using hashes here.

File details

Details for the file gerrychain-0.2.18-py3.8.egg.

File metadata

  • Download URL: gerrychain-0.2.18-py3.8.egg
  • Upload date:
  • Size: 129.4 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for gerrychain-0.2.18-py3.8.egg
Algorithm Hash digest
SHA256 a82bc060c665649ec7a0ede99f07c87a6f89353d1b6c4fed90ace7651eec1e85
MD5 598ef05b5af18b08b704c665e550728e
BLAKE2b-256 89f74347204ec2a87dadab5da0cb3d196dad937d9abd5ec98bb1c53f3508d5b6

See more details on using hashes here.

File details

Details for the file gerrychain-0.2.18-py2.py3-none-any.whl.

File metadata

  • Download URL: gerrychain-0.2.18-py2.py3-none-any.whl
  • Upload date:
  • Size: 55.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for gerrychain-0.2.18-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8baa02613b8489616daa6eba50c9e50e349dcb9ad1d3d192c7ed1ca53e736538
MD5 7397067148f6e3c861747fcbc6384770
BLAKE2b-256 e55d683e2660936c45f4f87f9c1414e49f2e5a1be3565766e4b604be2d01be6e

See more details on using hashes here.

Supported by

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