Add documentation for get_artifact_path

This commit is contained in:
c-bata
2024-01-24 09:45:52 +09:00
parent 7c83aa5b38
commit a9e5cd9b41
2 changed files with 13 additions and 1 deletions
+1
View File
@@ -66,6 +66,7 @@ Artifact
:nosignatures:
optuna_dashboard.artifact.upload_artifact
optuna_dashboard.artifact.get_artifact_path
optuna_dashboard.artifact.file_system.FileSystemBackend
optuna_dashboard.artifact.boto3.Boto3Backend
optuna_dashboard.artifact.backoff.Backoff
+12 -1
View File
@@ -52,7 +52,18 @@ def get_artifact_path(
study_or_trial: optuna.Trial | optuna.Study,
artifact_id: str,
) -> str:
"""Get the URL path for a given artifact ID."""
"""Get the URL path for a given artifact ID.
Args:
study_or_trial:
A Trial object, or a Study object.
artifact_id:
An artifact ID.
Returns:
A URL path to the artifact.
"""
if isinstance(study_or_trial, optuna.Study):
study_id = study_or_trial._study_id
return f"/artifacts/{study_id}/{artifact_id}"