qldpc.cache
Helper function(s) for caching results.
Attributes
Functions
|
Clear an entry from a local cache. |
|
Retrieve a dictionary-like cache object. |
|
Retrieve the path of a cache. |
|
Are we currently running with pytest? |
|
Decorator to cache results to disk. |
Module Contents
- qldpc.cache.clear_entry(cache_name: str, key: collections.abc.Hashable, *, cache_dir: pathlib.Path | str | None = None) None[source]
Clear an entry from a local cache.
- qldpc.cache.get_disk_cache(cache_name: str, *, cache_dir: pathlib.Path | str | None = None) diskcache.Cache[source]
Retrieve a dictionary-like cache object.
- qldpc.cache.get_disk_cache_path(cache_name: str, *, cache_dir: pathlib.Path | str | None = None) pathlib.Path[source]
Retrieve the path of a cache.
- qldpc.cache.use_disk_cache(cache_name: str, *, cache_dir: pathlib.Path | str | None = None, key_func: collections.abc.Callable[..., collections.abc.Hashable] | None = None) collections.abc.Callable[[collections.abc.Callable[Params, Any]], collections.abc.Callable[Params, Any]][source]
Decorator to cache results to disk.
- qldpc.cache.Params