Description
There are a lot of derived outputs that result from simple arithmetic on previously calculated outputs. Right now we repeat all of that calculation, which is not ideal. This problem could become even worse if the same base variable is repeated with several different types of aggregation and/or filtering. We would end up repeating the entire calculation each time, when all we really want to do is to redo the filtering and aggregation steps.
I think we could do this by replacing the allqueries
list with an environment. Then we could write intermediate outputs into the environment to be used in other modules. Modules would check the environment to see if their intermediate values are available, and if they aren't, they could call the relevant models directly, causing the intermediates to be filled in, before proceeding.