jellycell.cache.function_cache¶
Function-level memoization backed by :class:CacheStore.
Wires @jc.cache to the same content-addressed store that backs cell
caching. The key combines the function’s qualified name, its source text
(stripped by the same normalization as cell source), and a pickle hash of
the call arguments.
Limitations (documented + accepted for v0):
Arguments must be pickle-able. Non-picklable inputs (open file handles, lambdas, bound methods with non-picklable
self) raise at call time.Source changes invalidate every call — same principle as cell hashing.
Concurrent calls from the same process race on write (diskcache is atomic per-key; last-writer wins).
The decorator is transparent in standalone mode (no RunContext) — it just calls the function.
Module Contents¶
Functions¶
Memoize |
Data¶
API¶
- jellycell.cache.function_cache.F¶
‘TypeVar(…)’
- jellycell.cache.function_cache.cache_function(fn: jellycell.cache.function_cache.F) jellycell.cache.function_cache.F¶
Memoize
fnvia the current run’s CacheStore.Identity operation outside a run (
get_context()returnsNone) so the same decorator works in notebooks and in standalone scripts.