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

precomp decorator support

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.
parent 77cd32f8
No related branches found
No related tags found
No related merge requests found
Loading
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