csnlp.core.cache#

A collection of methods to handle caching in the package. In particular, it offers a decorator invalidate_cache that allows to invalidate the cache of a given set of other cached properties or methods when the decorated method is invoked, as well as a function invalidate_caches_of that allows to invalidate the cache of a given object on the fly.

Functions

invalidate_cache(*callables)

Decorator that allows to enhance a function or method with the ability, when called, to invalidate and clear the cached of some other target methods/properties.

invalidate_caches_of(obj)

Similar to the decorator invalidate_cache, but clears the case of the given object only once.