force_recalculate method

force_recalculate

Whether force given function to be recalculated always when calculating shared formulas.

Returns

true if the specified function needs to be recalculated always.

def force_recalculate(self, function_name):
    ...
ParameterTypeDescription
function_namestrname of the function. Generally it is custom function’s name.
If AbstractCalculationEngine.process_built_in_functions is true, then built-in functions will also be checked here.

Remarks

For shared formulas, multiple cells share the same function. If the function’s parameters keep same for those cells too, then generally this function needs to be calculated only once. So for performance consideration we only calculate such kind of function once too(AbstractCalculationEngine.calculate is called only once, instead of being called repeatedly for every cell). However, for user’s custom implementation, maybe the function, especially the custom function, needs to be calculated differently for different cells. If so, user needs to override this method to make it return true for the function. And for AbstractCalculationEngine.calculate, the given CalculationData.calculated_value may have been initialized with the cached value of previous calculation.

See Also