utils.mlflow_io#
MLflow I/O utilities for fetching runs and artifacts.
This module provides helpers for retrieving experiment data from MLflow/Databricks and downloading artifacts to the local data directory.
Functions
|
Download artifacts from MLflow runs to local directory. |
|
Download HDF5 artifacts with standardized naming. |
|
Load runs from an MLflow experiment. |
Configure MLflow authentication. |
- utils.mlflow_io.download_artifacts(experiment: str, output_dir: Path, converged_only: bool = True, artifact_filter: List[str] | None = None) List[Path][source]#
Download artifacts from MLflow runs to local directory.
- Parameters:
- experiment
str Experiment name (e.g., “HPC-FV-Solver”).
- output_dir
Path Directory to save artifacts. Files are named based on run parameters.
- converged_onlybool, default
True Only download from converged runs.
- artifact_filter
listofstr, optional Only download artifacts matching these patterns (e.g., [”.h5”, “.png”]). If None, downloads all artifacts.
- experiment
- Returns:
listofPathPaths to downloaded files.
Examples
>>> paths = download_artifacts("HPC-FV-Solver", Path("data/FV-Solver")) >>> print(paths) [Path('data/FV-Solver/LDC_N32_Re100.h5'), ...]
- utils.mlflow_io.download_artifacts_with_naming(experiment: str, output_dir: Path, converged_only: bool = True) List[Path][source]#
Download HDF5 artifacts with standardized naming.
Names files as: POISSON_N{n}_Iter{iter}.h5 (Adapted for LSM)
- utils.mlflow_io.load_runs(experiment: str, converged_only: bool = True, exclude_parent_runs: bool = True) DataFrame[source]#
Load runs from an MLflow experiment.
- Parameters:
- Returns:
pd.DataFrameDataFrame with run info, parameters (params.*), and metrics (metrics.*).
Examples
>>> df = load_runs("HPC-FV-Solver") >>> df[["run_id", "params.nx", "metrics.wall_time_seconds"]]