diff --git a/docs/conf.py b/docs/conf.py index 45cbf296..35050f11 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -5,12 +5,13 @@ import os import sys + # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information project = "Optuna Dashboard" copyright = "2023, Optuna Dashboard Contributors" -author = "Masashi Shibata" +author = "Optuna Dashboard Contributors." # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/optuna_dashboard/_app.py b/optuna_dashboard/_app.py index 97f58aa9..d91710f6 100644 --- a/optuna_dashboard/_app.py +++ b/optuna_dashboard/_app.py @@ -511,9 +511,12 @@ def run_server( artifact_backend: Optional[ArtifactBackend] = None, ) -> None: """Start running optuna-dashboard and blocks until the server terminates. + This function uses wsgiref module which is not intended for the production use. If you want to run optuna-dashboard more secure and/or more fast, - please use WSGI server like Gunicorn or uWSGI via `wsgi()` function. + please use WSGI server like Gunicorn or uWSGI via :func:`wsgi` function. + + """ app = create_app(get_storage(storage), artifact_backend=artifact_backend) run(app, host=host, port=port) diff --git a/optuna_dashboard/artifact/file_system.py b/optuna_dashboard/artifact/file_system.py index 45e530f1..bd24f25b 100644 --- a/optuna_dashboard/artifact/file_system.py +++ b/optuna_dashboard/artifact/file_system.py @@ -6,6 +6,24 @@ from typing import TYPE_CHECKING class FileSystemBackend: + """An artifact backend for file systems. + + Example: + .. code-block:: python + + import optuna + from optuna_dashboard.artifact import upload_artifact + from optuna_dashboard.artifact.file_system import FileSystemBackend + + artifact_backend = FileSystemBackend("./artifacts") + + def objective(trial: optuna.Trial) -> float: + ... = trial.suggest_float("x", -10, 10) + file_path = generate_example_png(...) + upload_artifact(artifact_backend, trial, file_path) + return ... + """ + def __init__(self, base_path: str) -> None: self._base_path = base_path