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

Noise.run() opportunistically call load()

cache the load status
parent 73cc9a5e
Branches
Tags
1 merge request!95precomp decorator support
Pipeline #160746 passed
......@@ -129,6 +129,7 @@ class BudgetItem:
self.freq = freq
for key, val in kwargs.items():
setattr(self, key, val)
self._loaded = False
@property
def name(self):
......@@ -226,13 +227,17 @@ class Noise(BudgetItem):
calc_trace() in sequence. Keyword arguments are passed to the
update() method.
NOTE: The load status is cached such that subsequent calls to
this method will not re-execute the load() method.
NOTE: The update() method is only run if keyword arguments
(`kwargs`) are supplied, or if the `ifo` attribute has
changed.
"""
if not self._loaded:
self.load()
self.update(**kwargs)
self._loaded = True
ifo = kwargs.get('ifo', getattr(self, 'ifo'))
if ifo:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment