Baseline Workflow

This page describes the workflow for generating a baseline map for a state, using the code in Alec’s baseline repository which in turn uses the code in Todd’s dccvt repository.

Summary

Download files

The data for VTDs (precincts) came from these sources:

Create output directories

Extract & format data

Extract the population & coordinates of precincts and put it into the format that Todd’s dccvt package expects.

scripts/extract_data.py -s XX

Create block-to-VTD and VTD-to-block mappings (or block-to-BG and BG-to-block mappings for the states that use BG’s instead of VTD’s).

scripts/extract_blocks_by_vtd.py -s XX
scripts/extract_blocks_by_bg.py -s XX

Extract a graph of precincts

Similarly, extract a graph of the precincts and put them into the format that Todd’s dccvt package expects.

scripts/extract_graph.py -s XX

Generate candidate baselines

Use the baseline_state.py script to generate 100 baseline candidates.

scripts/baseline_state.py -s XX -i 100 -v > intermediate/XX/XX20C_log_100.txt

Compare the candidate maps

Use the compare_maps.py script to compare them.

scripts/compare_maps.py -s XX -i 100 -v

Choose a baseline

Designate the lowest energy contiguous candidate with population deviation <= 2% (+/– 1%) as the baseline.

The specific workflow for each state — along with command arguments — are in the workflows/ directory of Alec’s baseline repository.