I'm re-writing an analysis application that calculates dozens of factors that are later used in a statistical model. Currently, the application is structured where the various factors are calculated as such...
factor1 = calculate_factor1()
factor2 = calculate_factor2()
factor3 = calculate_factor3()
...and so on.
But what if the function calculate_factor2()
is updated? Because the factors are stored in a database, every other factor does not need to be re-calculated every time the program runs. Or, as another example, we might add factor67
and do not need to calculate the rest.
Right now, we are currently commenting out the lines of factors we don't need to calculate. There has to be a better way?