mantik.runs.notebook

Attributes

active_run_ctx

project_id_ctx

run_id_ctx

Functions

autolog(→ None)

end_run(→ None)

log_artifact(→ None)

log_artifacts(→ None)

log_dict(→ None)

log_metric(→ None)

log_metrics(→ None)

log_param(→ Any)

log_params(→ None)

log_text(→ None)

start_run(run_name[, project_id, ...])

Start a new MLflow run with Mantik integration.

Module Contents

mantik.runs.notebook.active_run_ctx[source]
mantik.runs.notebook.autolog(log_input_examples: bool = False, log_model_signatures: bool = True, log_models: bool = True, disable: bool = False, exclusive: bool = False, disable_for_unsupported_versions: bool = False, silent: bool = False) None[source]
mantik.runs.notebook.end_run(status: str = 'FINISHED') None[source]
mantik.runs.notebook.log_artifact(local_path: str, artifact_path: str | None = None) None[source]
mantik.runs.notebook.log_artifacts(local_dir: str, artifact_path: str | None = None) None[source]
mantik.runs.notebook.log_dict(dictionary: Any, artifact_file: str) None[source]
mantik.runs.notebook.log_metric(key: str, value: float, step: int | None = None) None[source]
mantik.runs.notebook.log_metrics(metrics: Dict[str, float], step: int | None = None) None[source]
mantik.runs.notebook.log_param(key: str, value: Any) Any[source]
mantik.runs.notebook.log_params(params: Dict[str, Any]) None[source]
mantik.runs.notebook.log_text(text: str, artifact_file: str) None[source]
mantik.runs.notebook.project_id_ctx[source]
mantik.runs.notebook.run_id_ctx[source]
mantik.runs.notebook.start_run(run_name: str, project_id: uuid.UUID | None = None, experiment_repository_id: uuid.UUID | None = None, nested: bool = False)[source]

Start a new MLflow run with Mantik integration.

This function initiates a new MLflow tracking run and registers it with Mantik. It handles run configuration, infrastructure tracking, and notebook source detection.

Parameters:
  • run_name (str) – Name of the run to be created.

  • project_id (Optional[uuid.UUID], default=None) –

    UUID of the project to associate the run with. If not provided, will attempt to read from the PROJECT_ID environment

    variable.

  • experiment_repository_id (Optional[uuid.UUID], default=None) – UUID of the experiment repository to associate the run with. If not provided, will attempt to read from the EXPERIMENT_RESPOSITORY_ID environment variable.

  • nested (bool, default=False) – If True, creates a nested run within an active parent run.

Returns:

The active MLflow run object that was started.

Return type:

mlflow.ActiveRun

Raises:

ValueError – If project_id or experiment_repository_id cannot be determined from arguments or environment variables.

Notes

Requires the MLFLOW_TRACKING_TOKEN environment variable to be set.