c4 districting software with dependencies
156
This container packs the C4 redistricting software along with all of its dependencies. The container is about 2GB.
Running from scratch is as simple as:
docker run -v $(pwd)/res/:/C4/res/ -e STATE=pa -e SEED=2 -e METHOD=POWER --rm -it jamessaxon/c4:replication
This means:
docker run [...] jamessaxon/c4:replication)res/ to /C4/res/ in the container. Results written here will be available when the jobs completes. You must make the res/ directory!!STATE of Pennsylvania (USPS code pa), with SEED of 2 (any number, but < 1000 will format better), using the POWER diagram METHOD. You can also specify the SHADING (-e SHADING=all).
POWER DIST RADII IPQ CIRCLES HULL_P HULL_A INERTIA AXIS SPLIT PATH_FRAC. Several of these run several methods in sequence. For instance CIRCLES runs the exchange, reock and ehrenburg methods, and RADII includes rohrbach, harm_radius, mean_radius, and dyn_radius .--rm) the container when it exits.-it).Of course, you can also run interactively with /bin/bash and just cd to C4 to use run.py with all of its arguments.
In that case, skip to Running C4, below.
For large-scale jobs, I run C4 as a Docker container on AWS.
The Dockerfile changes very slightly, with AWS keys and s3 tools (see DockerfileAWS).
The scripts for building the container and launching jobs
are also in this directory (though they won't run, without dependencies or passwords!).
Four types of files will be written to res/ (your local directory).
Note again that, running with docker, the directory must be mounted to a local file.
res/json/[state usps]_[method]_s[seed]_c[cycle].json. These files contain a summary of the entire run: the tract to district assignment, the spatial parameters of the districts, the partisan voting (if available for that state), race and ethnicity, voter balance (PopulationDeviation), the method used, and so forth (run jq keys file.json to see this). These datares/[state usps]/[method]/s[seed]/c[cycle]/final.csv.final.geojson, in the same directory as (2). These contain the basic plan and some of the information of (1). They are in in the EPSG 4326 coordinate reference system, and display nicely on GitHub or Gist or in Leaflet etc.final_*.pdf are static maps of the districting plans. There will be one map for each shading method used.Content type
Image
Digest
Size
729.2 MB
Last updated
over 7 years ago
docker pull jamessaxon/c4:replication