mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-11 12:30:25 +08:00
Update docstrings
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user