pyphi.cache.disk#

Disk-backed content-addressed store for top-level results.

Persists serialized results to one file per key under DISK_CACHE_LOCATION. Keys are opaque hex strings built by the key module functions; values are serialize-encoded results. A truncated or unreadable file decodes to None (a silent miss), never an exception reaching the caller; staleness across code or config changes is handled by the cache key (its code-version component), not an in-file tag.

Functions

maybe_disk_cached(system, kind, user_kwargs, ...)

Return a disk-cached result for compute() when it is safe to.

result_cache_key(system, kind, snapshot)

Hex cache key, or None (do not cache) when the git tree is dirty.

Classes

DiskCache(name, subdir)

A content-addressed file store satisfying the CachePolicy surface.