akkudoktoreos.core.cache

In-memory and file caching.

Decorators and classes for caching results of computations, both in memory (using an LRU cache) and in temporary files. It also includes mechanisms for managing cache file expiration and retrieval.

Functions

cache_clear([clear_all])

Cleanup expired cache files.

cache_energy_management(callable)

Decorator for in memory caching the result of a callable.

cache_energy_management_store_callback(...)

Calback function for CacheEnergyManagementStore.

cache_in_file([ignore_params, force_update, ...])

Cache the output of a function into a temporary file.

cache_load()

Load cache from cachefilestore.json.

cache_save()

Save cache to cachefilestore.json.

Classes

CacheEnergyManagementStore(*args, **kwargs)

Singleton-based in-memory LRU (Least Recently Used) cache.

CacheFileRecord(*, cache_file, until_datetime)

CacheFileStore(*args, **kwargs)

A key-value store that manages file-like tempfile objects to be used as cache files.