def get_ensemble_metrics_job(
        get_ensemble_config: dict,
        get_batch_predictions: list[dict],
    ) -> tuple[MetricsCalculationJob, str]:
        """Return Metrics calculation job and path to directory where metrics csv will be saved."""
        config = get_ensemble_config
        with TemporaryDirectory() as tmp_dir:
            metrics = MetricsCalculationJobGenerator(
                config["accelerator"],
                root_dir=Path(tmp_dir),
                model_args=config["TrainModels"]["model"],
            )

        mock_predictions = get_batch_predictions

        return next(metrics.generate_jobs(prev_stage_result=copy.deepcopy(mock_predictions))), tmp_dir
Return Metrics calculation job and path to directory where metrics csv will be saved.
tests/unit/pipelines/tiled_ensemble/test_components.py