DiskCache¶
- class hmf.core.cache.DiskCache(*, directory=NOTHING)[source]¶
Where, and whether, to keep Boltzmann-code output on disk.
Pass one as the
disk_cacheof aTransferorGrowthstage. See the module documentation for the key and the guarantees.- Parameters:
directory (Path, default computed) – The cache directory. Defaults to $HMF_CACHE_DIR, or the platform’s user cache directory for hmf (see default_cache_dir). It is created when the first entry is written.
Attributes
Methods
- classmethod fields_info() tuple[FieldInfo, ...]¶
Describe this class’s fields, without creating an instance.
- Returns:
The name, type, default and documentation of each field.
- Return type:
tuple of FieldInfo
- load(key: str) dict[str, ndarray[tuple[Any, ...], dtype[Any]]] | None[source]¶
Load the arrays stored under
key.- Parameters:
key – The content hash of the entry.
- Returns:
The arrays by name, or
Noneif there is no (readable) entry.- Return type:
dict or None