Skip to content

Commit

Permalink
adjust to include graph, avoid infinite cache leak
Browse files Browse the repository at this point in the history
  • Loading branch information
ksunden committed Aug 28, 2024
1 parent 6689927 commit c0321da
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions data_prototype/artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ def pick(self, mouseevent, graph: Graph | None = None):
# which do not have an axes property but children might
a.pick(mouseevent, graph)

def _get_dynamic_graph(self, query):
def _get_dynamic_graph(self, query, description, graph):
return Graph([])

def _query_and_eval(self, container, requires, graph, cacheset=None):
g = graph + self._graph
query, q_cache_key = container.query(g)
g = g + self._get_dynamic_graph(query)
g = g + self._get_dynamic_graph(query, container.describe(), graph)
g_cache_key = g.cache_key()
cache_key = (g_cache_key, q_cache_key)

Expand All @@ -141,9 +141,9 @@ def _query_and_eval(self, container, requires, graph, cacheset=None):
conv = g.evaluator(container.describe(), requires)
ret = conv.evaluate(query)

if cache is not None:
cache[cache_key] = ret
# TODO prune
# TODO: actually add to cache and prune
# if cache is not None:
# cache[cache_key] = ret

return ret

Expand Down

0 comments on commit c0321da

Please sign in to comment.