Commit 0f36fc1d by Anne Rogers

okay

parent 75560065
Showing with 9 additions and 6 deletions
......@@ -6,13 +6,16 @@ import sys
sys.path.insert(0, "../reading_shapes")
from util import recover_json, read_csv, create_json_file
def create_json_file(dictionary, path_file_name):
tract_str = str(dictionary)
with open(path_file_name + ".json", 'w') as json_file:
json.dump(tract_str, json_file)
STATES = ["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"]
SKIP = ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Texas", "New York", "Florida", "Pennsylvania", "Illinois", "Ohio", "Michigan", "Georgia"]
best_tract_dict = {}
for state in STATES:
tracts, num = algorithms_new.set_tracts(state=state)
d = algorithms_new.percents_countdown(tracts, num, 60)
best_tract_dict[state] = d[3]
util.create_json_file(best_tract_dict, "optimal_starting_tracts")
d = algorithms_new.percents_countdown(state, 60)
best_tract_dict[state] = d[3]
create_json_file(best_tract_dict, state + "_optimal_starting_tracts")
print(state, "optimal tract saved!")
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