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
mlflowmodule.- clientMlflowClient
MLflow client bound to the session tracking URI.
- Parameters:
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).
- 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:
- Return type:
Notes
Delegates to
scikitplot.mlflow._compat.resolve_download_artifacts, which applies the same preference order: modern public API first, then session-bound client fallback.