cache
cache
#
The single cache node — store a value at a path and return it.
CacheProcedure replaces the old file/bundle variants: the destination is a
Path[T] position, which already encodes whether it is a file or a directory
bundle, so one node covers both. It type-checks the value against the position by
structure, runs the value procedure, stores the result, and returns it (so the
cached value can flow on as T).
CacheProcedure
#
Bases: Procedure[T]
Store value at destination and return the cached value.
The destination is a Path[T]; the value must match its target type by
structure (Array[Image] and ImageSequence interchange, Image into
a Thumbnail slot is rejected). The |= / &= operators lower
path |= value (skip if exists) and path &= value (overwrite) to this
node.
Attributes:
| Name | Type | Description |
|---|---|---|
destination |
Procedure[Path]
|
The |
value |
Procedure[CGType]
|
The procedure producing the value to store. |
skip_if_exists |
Setting[bool]
|
If true, keep an existing stored value instead of
re-running |
Source code in capturegraph-lib/capturegraph/procedures/nodes/destination/cache.py
__post_init__()
#
Resolve _return_type to the value's type, validating it matches.