cached

forge.jitfunctionSince Forge API 1
Signaturepython
forge.jit.cached(func: F) -> F

Remember a function's result for the rest of one sweep.

Parameters

NameType
funcF

Put it on a plain function that takes arrays, numbers, text, True/False or None, and returns an array, a tuple or dict of arrays, or a number. A sweep then computes each distinct input once, however many combinations of settings share it. Outside a Forge run it is an ordinary function. A cached call with a keyword and the same call with a positional argument make two entries. Returned arrays are read only.