decorators#

This module contains decorators and utility functions for Pastas models.

Includes decorators for caching, configuring global settings, deprecation warnings, and other convenient methods for handling time, numba compiled code, etc.

Functions#

set_use_numba(→ None)

Enable or disable the use of Numba JIT compilation.

get_use_numba(→ bool)

Check if Numba JIT compilation is enabled.

set_use_cache(→ None)

Enable or disable the use of caching with cachetools.

get_use_cache(→ bool)

Check if caching with cachetools is enabled.

PastasDeprecationWarning(→ Any)

Provide a warning or error when a Pastas class, method or function is deprecated.

deprecate_args_or_kwargs(name, remove_version[, ...])

Provide a warning or error when a function argument is deprecated.

conditional_cachedmethod(cache_getter)

Decorator to conditionally cache a method using cachetools.cachedmethod.

temporarily_disable_cache()

Context manager to temporarily disable caching.

temporarily_enable_cache()

Context manager to temporarily enable caching.