From 384b2395bd2f604e47ca24a6bfbbbc61d0ceb4c1 Mon Sep 17 00:00:00 2001 From: Max Fan Date: Mon, 16 May 2022 11:43:24 -0400 Subject: [PATCH] Fix misspelled node_indicies [sic] --- gerrychain/tree.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gerrychain/tree.py b/gerrychain/tree.py index 611e0e62..81667af7 100644 --- a/gerrychain/tree.py +++ b/gerrychain/tree.py @@ -84,7 +84,7 @@ def __init__(self, graph, populations, ideal_pop, epsilon): self.tot_pop = sum(self.population.values()) self.ideal_pop = ideal_pop self.epsilon = epsilon - self.degrees = {node: graph.degree(node) for node in graph.node_indicies} + self.degrees = {node: graph.degree(node) for node in graph.node_indices} def __iter__(self): return iter(self.graph) @@ -185,7 +185,7 @@ def bipartition_tree_retworkx( balanced_node_choices = retworkx.bipartition_tree(graph.pygraph, lambda x: random.random(), pops, float(pop_target), float(epsilon)) balanced_nodes = {graph.retworkx_networkx_mapping[x] for x in choice(balanced_node_choices)[1]} - return (balanced_nodes, graph.node_indicies - balanced_nodes) + return (balanced_nodes, graph.node_indices - balanced_nodes) def bipartition_tree( @@ -225,7 +225,7 @@ def bipartition_tree( :param choice: :func:`random.choice`. Can be substituted for testing. :param max_atempts: The max number of attempts that should be made to bipartition. """ - populations = {node: graph.lookup(node, pop_col) for node in graph.node_indicies} + populations = {node: graph.lookup(node, pop_col) for node in graph.node_indices} possible_cuts = [] if spanning_tree is None: @@ -263,7 +263,7 @@ def _bipartition_tree_random_all( max_attempts=None ): """Randomly bipartitions a graph and returns all cuts.""" - populations = {node: graph.lookup(node, pop_col) for node in graph.node_indicies} + populations = {node: graph.lookup(node, pop_col) for node in graph.node_indices} possible_cuts = [] if spanning_tree is None: @@ -435,7 +435,7 @@ def get_seed_chunks( new_epsilon = epsilon chunk_pop = 0 - for node in graph.node_indicies: + for node in graph.node_indices: chunk_pop += graph.lookup(node, pop_col) while True: