Skip to content

dra2020/rdapy

Repository files navigation

rdapy

Redistricting analytics in Python

This repository (rdapy) re-implements the main analytics used in Dave's Redistricting, ignoring a few DRA-specific aspects (in particular, the five [0-100] ratings). Unlike the analytics used in the app (dra-analytics) which are implememented in TypeScript, these are implemented in Python.

Categories

The analytics are organized by area:

  • Compactness: Various measures of compactness
  • Equal: Population deviation
  • Graph: Checks for contiguity & embeddedness
  • Minority: Minority opportunity metrics
  • Partisan: Various measures of partisan bias & responsiveness, as well as support for rank-vote graphs and seats-votes curves
  • Splitting: County- & district-splitting and COI splitting

The samples directory contains some simple examples of how to exercies these functions and how to preprocess raw block-level data into the formats required by the analytics.

Installation

pip install rdapy

Usage

import rdapy

Automated Tests

pytest

Questions

Email questions to feedback.

About

Redistricting analytics in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages