decorators#

Module containing 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.

set_parameter(→ collections.abc.Callable)

Validate and set parameter values.

get_stressmodel(→ collections.abc.Callable)

Validate and retrieve stressmodel by name.

model_tmin_tmax(→ collections.abc.Callable)

Use model tmin and tmax settings as default values.

PastasDeprecationWarning(→ Any)

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

deprecate_args_or_kwargs(→ None)

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

njit(→ collections.abc.Callable)

Apply numba's njit to a function if numba is available.

latexfun(→ None)

Use deprecated latexify functionality.

conditional_cachedmethod(cache_getter)

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.