Commit 9e83bf42 by Anne Rogers

final

parent 3fad05c2
Showing with 14 additions and 6 deletions
Before Preceeding Please run:
git fetch - all
sudo pip3 install pyshp
Use the following link to download the census tract data
http://www2.census.gov/geo/tiger/TIGER2010DP1/Tract_2010Census_DP1.zip
algorithms directory:
algorithms.py contains all the functions for constructing district plans by utilizing
the efficiency gap
__name__=="__main__" Function works if no specialization is needed
if specialization is needed
RUN [1] completed_result(state, initial_percent_of_people=60, goal=5,
RUN using python 3 [1] completed_result(state, initial_percent_of_people=60, goal=5,
special_name='', better=False)
drawing.py (must be run using Python2) creates a basemap of the United States and maps color-
coded tracts (the color corresponding to their district) onto the basemap using Networkx
coded tracts (the color corresponding to their district) onto the basemap using Networkx
Run the function in the terminal as follows:
python2 state_name
ie.
Python 2
Colors.csv contains numbers and colors for drawing.py
./demo.sh contains basic shell script
FOR EASY RUN USE ./demo.sh State
if State is two words it should be first_second
reading_shapes directory:
......
# !/bin/bash
#echo $1 $2
echo `python3 algorithms_new.py $1 $2 $3`
#echo $1 $2
echo `python2 drawing.py $1 $3`
echo `python3 algorithms_new.py $1`
echo `python2 drawing.py $1`
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment