utils.caching

utils.caching

Functions

Name Description
cache Caching decorator - use with care!
clear_all_cache Clear all caches in the current cache root.
clear_experiment_cache Clear the cache for the current experiment / notebook.
set_cache_path Set the path where the cache is stored, relative to the cache root which lies next to this file in /cache.

cache

utils.caching.cache(fname='', redo=False)

Caching decorator - use with care!

Brings variable in global scope and assigns it either a cached version or the result of decorated function.

  • fname: name of the file where the computation is stored under cache_path
  • redo: if True, the computation is run even if the file already exists

clear_all_cache

utils.caching.clear_all_cache()

Clear all caches in the current cache root.

clear_experiment_cache

utils.caching.clear_experiment_cache()

Clear the cache for the current experiment / notebook.

set_cache_path

utils.caching.set_cache_path(experiment='')

Set the path where the cache is stored, relative to the cache root which lies next to this file in /cache.

  • experiment: name of the experiment / notebook -> becomes a subdirectory in the cache root