Skip to main content

custom_lru_cache

Least-recently-used cache decorator. If maxsize is set to None, the LRU features are disabled and the cache can grow without bound. If typed is True, arguments of different types will be cached separately. For example, f(decimal.Decimal(“3.0”)) and f(3.0) will be treated as distinct calls with distinct results. Some types such as str and int may be cached separately even when typed is false. Arguments to the cached function must be hashable. View the cache statistics named tuple (hits, misses, maxsize, currsize) with f.cache_info(). Clear the cache and statistics with f.cache_clear(). Access the underlying function with f.wrapped. See: https://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)

remove_nans

Decorator that cleans all numpy array arguments (except self) by removing NaN values. This decorator processes each numpy array argument passed to the decorated function by:
  1. Dropping rows that are entirely NaNs in any of the arrays.
  2. Dropping columns (after row filtering) that contain any NaNs in any of the arrays.
All numpy array arguments must have the same shape, otherwise a ValueError is raised. Parameters: Raises: Returns:

filter_config

A decorator to filter a list of Feature objects based on search terms from the function signature. The decorated method must take a search parameter (str or list of str) and have access to self.feature. It filters the list by searching within id (case-sensitive), study_name, and timeframe (case-insensitive) attributes. Supports substring matching and prefix matching with trailing *. Returns:

catch_exceptions

Guard against schedule exceptions. Schedule library doesn’t catch exceptions that happen during job execution. Therefore any exceptions thrown during job execution will bubble up and interrupt schedule’s run_xyz function. Parameters: Returns:

deprecated

Decorator to mark functions as deprecated and prevent their use. When the decorated function is called, a DeprecationWarning is issued, and a RuntimeError is raised to stop execution. Parameters: Raises: Returns: Examples: