decorators#

Module containing decorators and utility functions for Pastas models.

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

Functions#

deprecate_class_func_or_method(version[, reason]) → Any

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

deprecate_args_or_kwargs(name, version[, reason]) → None

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

set_use_numba(b) → None

Enable or disable the use of Numba JIT compilation.

get_use_numba() → bool

Check if Numba JIT compilation is enabled.

set_use_cache(b) → None

Enable or disable the use of caching with cachetools.

get_use_cache() → bool

Check if caching with cachetools is enabled.

set_parameter(function) → collections.abc.Callable

Validate and set parameter values.

get_stressmodel(function) → collections.abc.Callable

Validate and retrieve stressmodel by name.

check_argument_model(function) → collections.abc.Callable

Check if the first argument is a pastas Model.

model_tmin_tmax(function) → collections.abc.Callable

Use model tmin and tmax settings as default values.

njit([function]) → collections.abc.Callable

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

latexfun(**kwargs) → 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.