Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docstring for plugin #46

Merged
merged 2 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/neptune_mlflow_exporter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
@click.option(
"--exclude-artifacts",
"-e",
help="Specifies whether to also include artifacts in the upload",
help="Specifies whether to exclude artifacts from the upload",
required=False,
default=False,
type=bool,
Expand Down
28 changes: 28 additions & 0 deletions src/neptune_mlflow_plugin/impl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,34 @@

@functools.wraps(neptune.init_run)
def create_neptune_tracking_uri(**kwargs) -> str:
"""Sets up a Neptune tracking URI for logging MLflow experiment metadata.

This lets you direct your metadata to Neptune instead of MLflow, without needing to change your MLflow logging code.

The function wraps neptune.init_run(), so you have the same parameters available for customizing your run or
limiting what is logged. The exceptions are with_id and custom_run_id, which will be ignored if provided (as calling
this function always creates a new Neptune run).
For the full list, see the Neptune documentation: https://docs.neptune.ai/api/neptune/#init_run

Examples:
Create default Neptune tracking URI:
>>> from neptune_mlflow_plugin import create_neptune_tracking_uri
>>> uri = create_neptune_tracking_uri()
>>> mlflow.set_tracking_uri(uri)
>>> with mlflow.start_run() as mlflow_run:
... ...

Create Neptune run with more customized options:
>>> uri = create_neptune_tracking_uri(
... name="my-custom-run-name",
... description="Description of the run",
... tags=["test", "mlflow"],
... source_files="**/.py",
... dependencies="infer",
... )

For detailed instructions, see the Neptune-MLflow integration guide: https://docs.neptune.ai/integrations/mlflow/
"""
kwargs["tags"] = (
list(kwargs["tags"]) if ("tags" in kwargs and isinstance(kwargs["tags"], set)) else kwargs.get("tags")
)
Expand Down
Loading