Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Andrew Friedman
/
Fairly Draw Election Districts
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9e83bf42
authored
Mar 14, 2017
by
Anne Rogers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
final
parent
3fad05c2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
README.txt
algorithms/demo.sh
README.txt
View file @
9e83bf42
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:
...
...
algorithms/demo.sh
View file @
9e83bf42
# !/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
`
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment