Commit 34e283c7 by Garrett Johnson

Merge branch 'master' of mit.cs.uchicago.edu:ajfriedman/election_district_drawing

parents 644dc4f3 75560065
Showing with 9 additions and 4 deletions
......@@ -941,13 +941,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
......@@ -1002,6 +1001,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)
......@@ -1111,4 +1117,4 @@ if __name__=="__main__":
create_json_file(district_plan,"district_plans/" + sys.argv[1])
d = recover_json("district_plans/" + "Iowa" + ".json")
print(d)
\ No newline at end of file
print(d)
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