Giter Site home page Giter Site logo

r-barnes / redistricter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brianolson/redistricter

0.0 2.0 0.0 4.66 MB

open source impartial algorithmic redistricting

Python 38.38% Makefile 0.51% C++ 36.99% Objective-C 3.91% C 1.86% HTML 2.29% JavaScript 1.16% CSS 0.11% Java 14.79%

redistricter's Introduction

This is Open Source software to create impartial optimally compact district maps for US State Legislatures and Congressional districts.

Results can be seen here:
http://bdistricting.com/2010/

And with analysis of partisan outcomes models here:
https://projects.fivethirtyeight.com/redistricting-maps/#algorithmic-compact


DEPENDENCIES:
	C++ compiler (GCC or CLANG)
	Java 1.8+
	Python 3.6+
	png library
	zlib compression library
	google protocol buffers http://code.google.com/p/protobuf/

BUILDING:	

There's no ./configure because autoconf is hard. :-(

Instead, Makefile includes makeopts/`uname`.pre early on to set variables. See the Darwin and Linux examples.

So, if you're lucky, all you have to do is:
	make all

There is no `make install` because this is a tool for an experimenter. The binaries just live here where they're compiled.

If you want to leave makeopts/* alone, create a file localvars.make which gets included after that and before anything else. A good place to put your own settings.



RUNNING:

Setup a python environment:

# your Python version may vary, run `python3 --version` to check
python3 -m venv ve
# this assumes bash or sh-like shell, to source a script into your session
. ve/bin/activate
pip install -r python/requirements.txt

Make a directory, which I traditionally call "data", to hold the Census data, and fetch a state of data into it, run preprocessing:

mkdir data
./bin/setupstatedata ct

Run from local data:

./bin/run_devmode --port=8080

The --port argument is optional, but runs a handy HTTP server on that port (e.g. http://localhost:8080/ ) which nicely displays status and results.

Lots of other options are available on both ./setupstatedata and ./run_devmode and there is --help available for them.


---
* Setting up protobuf
# Here's the cheat sheet for building this quickly.
./configure

# then build C and optionally python
make
make check
sudo make install

# while Python virtual environment setup above is active:
cd ../python
python setup.py test
python setup.py install

redistricter's People

Contributors

brianolson avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.