pastas.decorators.conditional_cachedmethod#

pastas.decorators.conditional_cachedmethod(cache_getter)#

Decorator to conditionally cache a method using cachetools.cachedmethod.

This decorator checks the global USE_CACHE flag and only applies caching when both cachetools is available and caching is enabled.

Parameters:

cache_getter (callable) – Function that returns the cache object from self (e.g., lambda self: self._cache)