diff --git a/.gitignore b/.gitignore index fb5130a..85237a6 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,6 @@ examples/*.png NC_ensemble_10000 debug.py + +maryland +new_hampshire diff --git a/rba/district_quantification.py b/rba/district_quantification.py index 353f3c1..f6b7716 100644 --- a/rba/district_quantification.py +++ b/rba/district_quantification.py @@ -77,7 +77,9 @@ def quantify_districts(graph_file, district_file, difference_file, verbose=False with open(graph_file, "r") as f: graph_json = json.load(f) graph = nx.readwrite.json_graph.adjacency_graph(graph_json) - districts = load_districts(graph, district_file) + # districts = load_districts(graph, district_file) + with open(district_file, "r") as f: + districts = json.load(f) with open(difference_file, "r") as f: supercommunity_output = json.load(f) # Contains strings as keys. diff --git a/rba/ensemble.py b/rba/ensemble.py index b201c82..cc70e8c 100644 --- a/rba/ensemble.py +++ b/rba/ensemble.py @@ -444,7 +444,6 @@ def ensemble_analysis(graph_file, difference_file, vra_config_file, num_steps, n if optimize_vis: output_dir = vis_dir - # Save a histogram of statewide scores. plt.hist(scores_df["state_gerry_score"], bins=30) plt.axvline(scores_df["state_gerry_score"].mean(), color='k', linestyle='dashed', linewidth=1) @@ -466,7 +465,7 @@ def get_z_score(precinct, metric): districts_assignment[node] = district districts_partition = Partition(graph, assignment=districts_assignment) - _, ax = plt.subplots(figsize=(60, 30)) + _, ax = plt.subplots(figsize=(12.8, 9.6)) visualize_gradient_geopandas( sorted_node_names, get_value=partial(get_z_score, metric="score"),