precomp decorator support
3 unresolved threads
3 unresolved threads
Compare changes
Files
3- Jameson Rollins authored
nb.precomp decorator can be used to wrap BudgetItem.calc methods with functions that only need to be called once per budget run. nb.precomp(precomp_foo) def calc(self): ... Precomp functions are all executed by the update() method (after attribute update), and execution state is cached at the Budget level, to prevent re-calculating the same functions multiple times per update. The BudgetItem.update() method is no longer expected to be overloaded by the user. This provides a speed-up of about 50% for the Aplus model, but much less for the CE models which are limited by other noise calculations.
+ 61
− 39
@@ -127,15 +127,6 @@ def precomp_mirror(f, ifo):
@@ -146,6 +137,31 @@ def precomp_suspension(f, ifo):
@@ -164,9 +180,9 @@ class QuantumVacuum(nb.Noise):
@@ -180,6 +196,7 @@ class StandardQuantumLimit(nb.Noise):
@@ -193,8 +210,8 @@ class Seismic(nb.Noise):
@@ -275,9 +292,10 @@ class SuspensionThermal(nb.Noise):
@@ -290,12 +308,13 @@ class CoatingBrownian(nb.Noise):
@@ -303,14 +322,17 @@ class CoatingBrownian(nb.Noise):
@@ -324,16 +346,17 @@ class CoatingThermoOptic(nb.Noise):
@@ -347,13 +370,12 @@ class ITMThermoRefractive(nb.Noise):
@@ -366,12 +388,12 @@ class SubstrateBrownian(nb.Noise):
@@ -385,12 +407,12 @@ class SubstrateThermoElastic(nb.Noise):