torchcell.paper.tables.SignalCache
- class SignalCache(*, path: ~pathlib.Path, entries: dict[str, ~torchcell.paper.tables._CacheEntry] = <factory>)[source]
Bases:
BaseModelJSON-backed memo of
(n, bytes)per id, keyed by LMDB fingerprint.Reuse across runs so only rebuilt datasets recompute.
entriesmaps a stable id (e.g. a dataset subpath) to its last computed signal + the LMDB fingerprint it was computed from.- classmethod load(path: str | Path) SignalCache[source]
Load an existing cache JSON, or return an empty cache for a new path.
- get_or_compute(cache_id: str, lmdb_dir: str | ~pathlib.Path, *, extract: ~collections.abc.Callable[[dict[str, ~typing.Any]], bytes] = <function default_phenotype_bytes>, label: str = '', log: ~collections.abc.Callable[[str], None] = <built-in function print>) tuple[int, int, bool][source]
Return
(n, bytes, from_cache), computing + persisting on a miss.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].