Skip to content

comet_ml.LoggedArtifact ¶

LoggedArtifact(
    artifact_name: str,
    artifact_type: str,
    artifact_id: str,
    artifact_version_id: str,
    workspace: str,
    rest_api_client: RestApiClient,
    experiment_key: str,
    version: str,
    aliases: List[str],
    artifact_tags: List[str],
    version_tags: List[str],
    size: int,
    metadata: Dict[str, Any],
    source_experiment_key: str,
    summary: Summary,
    config: Config,
)

You shouldn't try to create this object by hand, please use comet_ml.Experiment.get_artifact instead to retrieve an artifact.

Attributes¶

aliases property ¶

aliases

The set of logged artifact aliases.

artifact_tags property ¶

artifact_tags

The set of logged artifact tags.

artifact_type property ¶

artifact_type

The logged artifact type.

assets property ¶

assets: List[LoggedArtifactAsset]

The list of LoggedArtifactAsset that have been logged with this LoggedArtifact.

metadata property ¶

metadata

The logged artifact metadata.

name property ¶

name

The logged artifact name.

remote_assets property ¶

remote_assets: List[LoggedArtifactAsset]

The list of remote LoggedArtifactAsset that have been logged with this LoggedArtifact.

size property ¶

size

The total size of logged artifact version; it is the sum of all the artifact version assets.

source_experiment_key property ¶

source_experiment_key

The experiment key of the experiment that created this LoggedArtifact.

version property ¶

version: Version

The logged artifact version, as a SemanticVersion. See https://python-semanticversion.readthedocs.io/en/latest/reference.html#semantic_version.Version for reference

version_tags property ¶

version_tags

The set of logged artifact version tags.

workspace property ¶

workspace

The logged artifact workspace name.

Functions¶

download ¶

download(
    path: Optional[str] = None,
    overwrite_strategy: Union[bool, str] = False,
    sync_mode: bool = True,
) -> Artifact

Download the current Artifact Version assets to a given directory (or the local directory by default).

This method downloads assets and remote assets that were synced from a compatible cloud object storage (AWS S3 or GCP GCS). Other non-remote assets are not downloaded and you can access their link with the artifact.assets property.

Parameters:

  • path (str, default: None ) –

    Where to download artifact version assets. If not provided, a temporary path will be used, the root path can be accessed through the Artifact object which is returned by download under the .download_local_path attribute.

  • overwrite_strategy (bool | str, default: False ) –

    One of the three possible strategies to handle conflict when trying to download an artifact version asset to a path with an existing file. See below for allowed values. Default is False or "FAIL".

  • sync_mode (bool, default: True ) –

    Enables download of remote assets from the cloud storage platforms (AWS S3, GCP GS).

Returns:

  • Artifact ( Artifact ) –

    The Artifact downloaded object

Note

Overwrite strategy allowed values:

  • False or "FAIL": If a file already exists and its content is different, raise the comet_ml.exceptions.ArtifactDownloadException.
  • "PRESERVE": If a file already exists and its content is different, show a WARNING but preserve the existing content.
  • True or "OVERWRITE": If a file already exists and its content is different, replace it by the asset version asset.

get_asset ¶

get_asset(asset_logical_path) -> LoggedArtifactAsset

Returns the LoggedArtifactAsset object matching the given asset_logical_path or raises an Exception

get_source_experiment ¶

get_source_experiment(
    api_key: Optional[str] = None, cache: bool = True
) -> APIExperiment

Returns an APIExperiment object pointing to the experiment that created this artifact version, assumes that the API key is set else-where.

update_aliases ¶

update_aliases(new_aliases: Sequence[str]) -> None

Update the logged artifact tags

update_artifact_tags ¶

update_artifact_tags(new_artifact_tags: Sequence[str]) -> None

Update the logged artifact tags

update_version_tags ¶

update_version_tags(new_version_tags: Sequence[str]) -> None

Update the logged artifact version tags

Dec. 17, 2024