squirrel.artifact_manager.wandb

Module Contents

Classes

WandbArtifactManager

Helper class that provides a standard way to create an ABC using

Attributes

logger

squirrel.artifact_manager.wandb.logger
class squirrel.artifact_manager.wandb.WandbArtifactManager(entity: Optional[str] = None, project: Optional[str] = None, collection: str = 'default')

Bases: squirrel.artifact_manager.base.ArtifactManager

Helper class that provides a standard way to create an ABC using inheritance.

Artifact manager using Weights & Biases as backend.

Aligning this with the FileSystemArtifactManager, the collections correspond to WandB artifact types. However, a single WandB artifact can contain multiple files allowing the assignment of a single shared version to groups of files.

Note: For storing objects it is assumed that wandb.init() has been called so that artifacts can be associated with a run.

collection_to_catalog(collection: Optional[str] = None)squirrel.catalog.Catalog

Construct a catalog listing artifacts within a specific collection.

download_artifact(artifact: str, collection: Optional[str] = None, version: Optional[str] = None, to: Optional[pathlib.Path] = None)Union[pathlib.Path, squirrel.artifact_manager.base.TmpArtifact]

Download a specific artifact to a local path.

WandB serialised objects would be downloaded in a nested folder structure and are therefore discouraged right now.

exists_in_collection(artifact: str, collection: Optional[str] = None)bool

Check if artifact exists in specified collection.

Note: This is not supported by the WandB API and therefore requires listing all artifacts in a collection.

abstract get_artifact(artifact: str, collection: Optional[str] = None, version: Optional[str] = None)Any

Retrieve specific artifact value.

This assumes that the artifact was logged as a wandb serialised object. If the artifact was a file upload, the file contents should be retrieved using download instead.

get_artifact_source(artifact: str, collection: Optional[str] = None, version: Optional[str] = None, catalog: Optional[squirrel.catalog.Catalog] = None)squirrel.catalog.catalog.CatalogSource

Catalog entry for a specific artifact

list_collection_names()Iterable

List all collections managed by this ArtifactManager.

Collections correspond to Wandb artifact types.

abstract log_artifact(obj: Any, name: str, collection: Optional[str] = None)squirrel.catalog.catalog.Source

Log serialisable object to artifact store.

log_files(artifact_name: str, local_path: pathlib.Path, collection: Optional[str] = None, artifact_path: Optional[pathlib.Path] = None)squirrel.catalog.catalog.CatalogSource

Upload a single file to artifact store without serialisation.