OCDocker.OCScore.Optimization.OptunaStorage module¶
SQLite Optuna storage helpers for OCScore staged optimization.
Usage:
from OCDocker.OCScore.Optimization.OptunaStorage import resolve_optuna_storage
- OCDocker.OCScore.Optimization.OptunaStorage.configure_sqlite_wal(db_path)[source]¶
Enable WAL journal mode on a SQLite database file.
Creates the parent directory and database file when they do not exist.
- Parameters:
db_path (pathlib.Path) – SQLite database path.
- Return type:
None
- OCDocker.OCScore.Optimization.OptunaStorage.resolve_optuna_storage(storage, output_dir, filename='optuna.db')[source]¶
Resolve an Optuna storage URL and optional local SQLite path.
- Parameters:
storage (str | None) – Optuna storage URL. Use
"auto"for{output_dir}/{filename}.output_dir (pathlib.Path) – Protocol output directory used when
storageis"auto".filename (str, optional) – SQLite filename for
"auto"storage, by default"optuna.db".
- Returns:
Optuna storage URL and local SQLite path when applicable.
- Return type:
tuple[str | None, str | None]