diff --git a/gwinc/nb.py b/gwinc/nb.py index 2329d61656ac2fb07bda4e37a4143adf5e5ad6df..6828d816079c866c098bd96e35f29e5493334678 100644 --- a/gwinc/nb.py +++ b/gwinc/nb.py @@ -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. """ - self.load() - self.update(**kwargs) + if not self._loaded: + self.load() + self._loaded = True ifo = kwargs.get('ifo', getattr(self, 'ifo')) if ifo: