Skip to content

Commit

Permalink
Fix misspelled node_indicies [sic]
Browse files Browse the repository at this point in the history
  • Loading branch information
InnovativeInventor committed May 16, 2022
1 parent 51079ed commit 384b239
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gerrychain/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 384b239

Please sign in to comment.