Skip to content

Commit

Permalink
Re-enable lookup cache
Browse files Browse the repository at this point in the history
  • Loading branch information
InnovativeInventor committed Feb 15, 2022
1 parent 0738872 commit 03f11ae
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions gerrychain/graph/graph.py
Expand Up @@ -402,7 +402,6 @@ def edge_indicies(self):
def degree(self, n):
return self.graph.degree(n)

# @functools.lru_cache(65536) # memory leak
def lookup(self, node, field):
return self.graph.nodes[node][field]

Expand All @@ -418,4 +417,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
return attrs

0 comments on commit 03f11ae

Please sign in to comment.