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
75560065
authored
Mar 14, 2017
by
Anne Rogers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
f8bbd753
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
algorithms/algorithms_new.py
algorithms/algorithms_new.py
View file @
75560065
...
...
@@ -942,13 +942,12 @@ def make_gap_lower(districts_dict, all_tracts, num_districts, used_tracts,
plus_total_population_D_R
(
districts_dict
,
best_district
,
best_total
,
best_dem
,
best_rep
)
minus_total_population_D_R
(
districts_dict
,
check_pop
,
best_total
,
best_dem
,
best_rep
)
gap
=
calculate_efficiency_gap_from_dict
(
districts_dict
)
printer
=
[
"lower"
,
check_pop
,
count
]
for
num
in
districts_dict
:
printer
.
append
(
districts_dict
[
num
][
"total_population"
])
printer
.
append
(
calculate_efficiency_gap_from_dict
(
districts_dict
))
print
(
printer
)
gap
=
calculate_efficiency_gap_from_dict
(
districts_dict
)
return
districts_dict
...
...
@@ -1003,6 +1002,13 @@ def completed_result(state, initial_percent_of_people=60, goal=5,
make_gap_lower
(
districts_dict
,
state_tract
,
num_districts
,
used_tracts
,
goal
,
min_pop_district
,
max_pop_district
)
copy
=
dict
(
districts_dict
)
for
district_num
in
copy
:
dist_info
=
districts_dict
[
district_num
]
dist_str
=
str
(
district_num
)
districts_dict
[
dist_str
]
=
dist_info
del
districts_dict
[
district_num
]
create_json_file
(
districts_dict
,
"district_plans/"
+
state
+
special_name
)
...
...
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