Skip to content
Snippets Groups Projects
Commit c2d6f5dc authored by Jameson Rollins's avatar Jameson Rollins
Browse files

cache precomp data between runs

This prevents the precomp data from being re-calculated if the ifo
hasn't changed.
parent 12d568be
No related branches found
No related tags found
1 merge request!103cache precomp data between runs
Pipeline #161439 passed
...@@ -145,6 +145,7 @@ class BudgetItem: ...@@ -145,6 +145,7 @@ class BudgetItem:
for key, val in kwargs.items(): for key, val in kwargs.items():
setattr(self, key, val) setattr(self, key, val)
self._loaded = False self._loaded = False
self._precomp = dict()
@property @property
def name(self): def name(self):
...@@ -272,11 +273,12 @@ class Noise(BudgetItem): ...@@ -272,11 +273,12 @@ class Noise(BudgetItem):
kwargs['ifo'] = self.ifo kwargs['ifo'] = self.ifo
self._ifo_hash = ifo_hash self._ifo_hash = ifo_hash
_precomp = dict()
if kwargs: if kwargs:
self.update(**kwargs) self.update(**kwargs)
# clear precomp cache
self._precomp = dict()
return self.calc_trace(_precomp=_precomp) return self.calc_trace(_precomp=self._precomp)
class Budget(Noise): class Budget(Noise):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment