Skip to content

Commit

Permalink
Some more caching.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgokmen committed Sep 2, 2023
1 parent 67cbe89 commit fd3ab50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bddl/knowledge_base/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dataclasses import dataclass, field
from functools import cached_property
from functools import cached_property, cache
import itertools
import json
import networkx as nx
Expand Down Expand Up @@ -144,6 +144,7 @@ class Meta:
pk = 'name'
ordering = ['name']

@cache
def matching_synset(self, synset) -> bool:
return synset.name in self.matching_synsets

Expand Down Expand Up @@ -178,6 +179,7 @@ class Meta:
pk = 'name'
ordering = ['name']

@cache
def matching_synset(self, synset) -> bool:
return self.category.matching_synset(synset)

Expand Down

0 comments on commit fd3ab50

Please sign in to comment.