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.19.tar.gz (62.0 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.19-py3.8.egg (132.1 kB view details)

Uploaded Egg

gerrychain-0.2.19-py2.py3-none-any.whl (56.0 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: gerrychain-0.2.19.tar.gz
  • Upload date:
  • Size: 62.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for gerrychain-0.2.19.tar.gz
Algorithm Hash digest
SHA256 af6610ea8bc9e86ed22dca03d0570a2d50e2783685abc3142d2d20646c75a201
MD5 275febe7dbaac8415330f7f2940083b4
BLAKE2b-256 24b2a7f34ff1860b3d0f4c8c575ee729501c283d87d06639d20e0350b52c2f03

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gerrychain-0.2.19-py3.8.egg
  • Upload date:
  • Size: 132.1 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for gerrychain-0.2.19-py3.8.egg
Algorithm Hash digest
SHA256 d9ed40e7a2cb80a8d7b53be904aeeeed619762e62b03123ec9a71971b22de637
MD5 5dd7167b2194fc97a9e868cceb198982
BLAKE2b-256 ea7455632294a6d7faef84fe772dcab24e561d3e67d981f7e156783d229f2b5a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gerrychain-0.2.19-py2.py3-none-any.whl
  • Upload date:
  • Size: 56.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for gerrychain-0.2.19-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d0fae4a1b9c26f59f8377c5e00737635c8a62814ea6c6e3ae5a311c4b6521e9c
MD5 cf3601c4d6047633abf76ec321c6a4bc
BLAKE2b-256 c5abf7d6c3ece6ec422ccaf74861adba6c5d6214dc620f488c36922ad0b18beb

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