ArtifactsFacade#

class scikitplot.mlflow.ArtifactsFacade(mlflow_module=None, client=None)[source]#

Artifact helper facade bound to a specific MLflow client/URI.

Parameters:
mlflow_modulemodule

Imported mlflow module.

clientMlflowClient

MLflow client bound to the session tracking URI.

Parameters:
  • mlflow_module (Any)

  • client (Any)

Notes

The implementation is version-robust and deterministic:

  • Prefer the public modern API: mlflow.artifacts.download_artifacts.

  • Otherwise fallback to the session-bound client’s download_artifacts.

This avoids accidental use of a different tracking URI (e.g., when a new client is constructed without explicit configuration).

client: Any = None#
download(run_id, artifact_path, dst_path=None)[source]#

Download an artifact from a run.

Parameters:
run_idstr

MLflow run ID.

artifact_pathstr

Path relative to the run artifact root (e.g., “model/MLmodel”).

dst_pathstr or None, default=None

Optional destination directory.

Returns:
pathlib.Path

Local path to the downloaded file or directory.

Raises:
AttributeError

If no compatible artifact download API is available.

Parameters:
  • run_id (str)

  • artifact_path (str)

  • dst_path (str | None)

Return type:

Path

Notes

Delegates to scikitplot.mlflow._compat.resolve_download_artifacts, which applies the same preference order: modern public API first, then session-bound client fallback.

list(run_id, artifact_path=None)[source]#

List artifacts for a run.

Parameters:
run_idstr

MLflow run ID.

artifact_pathstr or None, default=None

Optional artifact subdirectory.

Returns:
list

List of artifact infos (type depends on MLflow version).

Parameters:
  • run_id (str)

  • artifact_path (str | None)

Return type:

list[Any]

log_file(local_path, artifact_path=None)[source]#

Log a local file as an artifact.

Parameters:
local_pathstr or pathlib.Path

Path to a local file.

artifact_pathstr or None, default=None

Optional destination path within the run artifact root.

Returns:
None
Parameters:
  • local_path (str | Path)

  • artifact_path (str | None)

Return type:

None

log_files(local_paths, artifact_path=None)[source]#

Log multiple local files as artifacts.

Parameters:
local_pathsSequence[str or pathlib.Path]

Paths to local files.

artifact_pathstr or None, default=None

Optional destination path within the run artifact root.

Returns:
None
Parameters:
Return type:

None

mlflow_module: Any = None#