Update docstrings

This commit is contained in:
c-bata
2023-02-16 13:28:19 +09:00
parent 900dd2a491
commit bb0882792e
3 changed files with 24 additions and 2 deletions
+2 -1
View File
@@ -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
+4 -1
View File
@@ -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)
+18
View File
@@ -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