This is a reference implementation of John F. Nagle's method for measuring redistricting bias & responsiveness and a code companion to his whitepaper which describes the method.
You have successfully replicated his basic method, if you can take the information in in Attachment 1 and produce the outputs in Attachment 2 and Attachment 3.
The example file does that, using the code in this repository within a Python environment.
The examples directory also contains pairs of files that define maps for PA, MD, and MA which can be analyzed at a command-line using the analyze_plan.py script.
This repository also supports the paper @alecramsay helped John Nagle write in Election Law Journal, “On Measuring Two-Party Partisan Bias in Unbalanced States.”
Distributed under the The MIT License (MIT) Copyright © 2018–2021 Alec Ramsay