From 405cb4a7e36fbb89d3b98f079ac7db1b76d22452 Mon Sep 17 00:00:00 2001 From: Max Fan Date: Thu, 13 Jan 2022 16:59:53 -0500 Subject: [PATCH] Debugging suspected memory leak --- gerrychain/graph/graph.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gerrychain/graph/graph.py b/gerrychain/graph/graph.py index 775218ef..b80c4847 100644 --- a/gerrychain/graph/graph.py +++ b/gerrychain/graph/graph.py @@ -371,14 +371,14 @@ def __init__(self, graph: Graph, pygraph: retworkx.PyGraph = None, mappings: Tup def __len__(self): return len(self.graph) - # @functools.cache # memory leak + # @functools.cache # memory leak? def __getattribute__(self, __name: str) -> Any: try: return object.__getattribute__(self, __name) except AttributeError: return object.__getattribute__(self.graph, __name) - @functools.cache + # @functools.cache # memory leak? def __getitem__(self, __name: str) -> Any: return self.graph[__name] @@ -406,7 +406,7 @@ def edge_indicies(self): def degree(self, n): return self.graph.degree(n) - @functools.cache + # @functools.cache def lookup(self, node, field): return self.graph.nodes[node][field] @@ -418,7 +418,7 @@ def subgraph(self, nodes): ) ) - @functools.cache + # @functools.cache def pygraph_pop_lookup(self, field: str): attrs = [0] * len(self.pygraph.node_indexes()) for node in self.pygraph.node_indexes():