diff --git a/gerrychain/graph/graph.py b/gerrychain/graph/graph.py index 6abaa4c6..cf5dd34e 100644 --- a/gerrychain/graph/graph.py +++ b/gerrychain/graph/graph.py @@ -402,7 +402,7 @@ def edge_indicies(self): def degree(self, n): return self.graph.degree(n) - # @functools.lru_cache(65536) # memory leak + @functools.lru_cache(65536) def lookup(self, node, field): return self.graph.nodes[node][field] @@ -418,4 +418,4 @@ def pygraph_pop_lookup(self, field: str): attrs = [0] * len(self.pygraph.node_indexes()) for node in self.pygraph.node_indexes(): attrs[node] = float(self.pygraph[node][field]) - return attrs \ No newline at end of file + return attrs