README
liblaf.cherries.core.assets
¶
Modules:
-
bundle–
Classes:
-
AssetPluginProtocol–Hook surface for plugins that receive artifact paths.
-
AssetsManager–Stage independent inputs and declared outputs inside an active run.
-
Bundle–Base class for artifact companion-file discovery.
-
BundleItem–Related file discovered for a logged artifact.
-
BundleRegistry–Registry that expands logged artifacts through matching bundles.
Attributes:
AssetPluginProtocol
¶
Bases: Protocol
flowchart TD
liblaf.cherries.core.assets.AssetPluginProtocol[AssetPluginProtocol]
click liblaf.cherries.core.assets.AssetPluginProtocol href "" "liblaf.cherries.core.assets.AssetPluginProtocol"
Hook surface for plugins that receive artifact paths.
-
API Reference
README
README
corePluginProtocol
-
API Reference
README
README
README
assetsAssetsManager
Methods:
-
log_asset–Record an existing artifact path.
log_asset
¶
Record an existing artifact path.
Parameters:
-
path(Path) –Existing file or directory to record.
-
metadata(Mapping[str, Any] | None, default:None) –Optional artifact metadata, usually including
type. -
report(bool, default:True) –Whether the path is the primary user-facing artifact. Companion files are logged with
report=False.
Source code in src/liblaf/cherries/core/assets/_protocol.py
AssetsManager
¶
Stage independent inputs and declared outputs inside an active run.
Parameters:
-
working_dir(Path) – -
plugins(AssetPluginProtocol) – -
bundles(BundleRegistry, default:BundleRegistry(registry=[BundleLandmarks(suffixes={'.obj', '.vtp', '.ply', '.stl', '.vtr', '.vtkhdf', '.vts', '.vtu', '.vti'}), BundleSeries()])) – -
summary(AssetsSummary, default:<dynamic>) –Paths successfully reported during a run.
The summary contains only primary artifacts. Bundle companions are sent to plugins, but omitted from this user-facing record.
-
pending(list[PendingAsset], default:<dynamic>) –Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
-
active(bool, default:False) – -
store(Store | None, default:None) – -
run_id(str | None, default:None) – -
bindings(list[dict[str, Any]], default:<dynamic>) –Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
-
retained_bundles(list[dict[str, Any]], default:<dynamic>) –Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
Methods:
Attributes:
-
active(bool) – -
bindings(list[dict[str, Any]]) – -
bundles(BundleRegistry) – -
data_dir(Path) – -
pending(list[PendingAsset]) – -
plugins(AssetPluginProtocol) – -
retained_bundles(list[dict[str, Any]]) – -
run_id(str | None) – -
store(Store | None) – -
summary(AssetsSummary) – -
temp_dir(Path) – -
working_dir(Path) –
bindings
class-attribute
instance-attribute
¶
bundles
class-attribute
instance-attribute
¶
bundles: BundleRegistry = attrs.field(default=bundles)
pending
class-attribute
instance-attribute
¶
retained_bundles
class-attribute
instance-attribute
¶
summary
class-attribute
instance-attribute
¶
end
¶
Source code in src/liblaf/cherries/core/assets/_manager.py
input
¶
input(
path: StrPath,
*,
name: StrPath | None = None,
source_run: str | None = None,
metadata: Mapping[str, Any] | None = None,
) -> Path
Source code in src/liblaf/cherries/core/assets/_manager.py
log_asset
¶
log_input
¶
log_output
¶
log_temp
¶
output
¶
Source code in src/liblaf/cherries/core/assets/_manager.py
temp
¶
Source code in src/liblaf/cherries/core/assets/_manager.py
Bundle
¶
Bases: ABC
flowchart TD
liblaf.cherries.core.assets.Bundle[Bundle]
click liblaf.cherries.core.assets.Bundle href "" "liblaf.cherries.core.assets.Bundle"
Base class for artifact companion-file discovery.
-
API Reference
README
README
README
assetsBundleRegistryregistry -
API Reference
README
README
README
README
bundleBundleRegistryregistry
Methods:
-
ls_files–Yield files that should be logged with
path. -
match–Return whether this bundle can expand
path.
ls_files
abstractmethod
¶
ls_files(path: Path) -> Iterable[BundleItem]
Yield files that should be logged with path.
Parameters:
-
path(Path) –Primary artifact path.
Returns:
-
Iterable[BundleItem]–Iterable of companion files and their optional/missing-file policy.
Source code in src/liblaf/cherries/core/assets/bundle/_abc.py
BundleItem
¶
Bases: NamedTuple
flowchart TD
liblaf.cherries.core.assets.BundleItem[BundleItem]
click liblaf.cherries.core.assets.BundleItem href "" "liblaf.cherries.core.assets.BundleItem"
Related file discovered for a logged artifact.
Attributes:
Parameters:
-
path(ForwardRef, default:None) – -
optional(ForwardRef, default:None) –
-
API Reference
README
README
README
assetsBundlels_files -
API Reference
README
README
README
assetsBundleRegistryls_files -
API Reference
README
README
README
README
bundleBundlels_files -
API Reference
README
README
README
README
bundleBundleLandmarksls_files -
API Reference
README
README
README
README
bundleBundleRegistryls_files -
API Reference
README
README
README
README
bundleBundleSeriesls_files
BundleRegistry
¶
Registry that expands logged artifacts through matching bundles.
Examples:
Parameters:
-
registry(list[Bundle], default:[BundleLandmarks(suffixes={'.obj', '.vtp', '.ply', '.stl', '.vtr', '.vtkhdf', '.vts', '.vtu', '.vti'}), BundleSeries()]) –
Methods:
-
ls_files–Yield companion files from every bundle that matches
path. -
register–Append
bundleto the registry.
Attributes:
registry
class-attribute
instance-attribute
¶
ls_files
¶
ls_files(path: Path) -> Generator[BundleItem]
Yield companion files from every bundle that matches path.