|
6 | 6 | import time |
7 | 7 | import warnings |
8 | 8 | from collections import OrderedDict |
| 9 | +from collections.abc import Callable |
9 | 10 | from pathlib import Path |
10 | 11 | from pprint import pprint |
11 | 12 | from typing import Any |
12 | | -from collections.abc import Callable |
13 | 13 |
|
14 | 14 | import gymnasium as gym |
15 | 15 | import numpy as np |
@@ -362,12 +362,10 @@ def read_hyperparameters(self) -> tuple[dict[str, Any], dict[str, Any]]: |
362 | 362 |
|
363 | 363 | return hyperparams, saved_hyperparams |
364 | 364 |
|
365 | | - def load_trial( |
366 | | - self, storage: str, study_name: str, trial_id: int | None = None, convert: bool = True |
367 | | - ) -> dict[str, Any]: |
| 365 | + def load_trial(self, storage: str, study_name: str, trial_id: int | None = None, convert: bool = True) -> dict[str, Any]: |
368 | 366 |
|
369 | 367 | if storage.endswith(".log"): |
370 | | - optuna_storage = optuna.storages.JournalStorage(optuna.storages.journal.JournalFileBackend(storage)) |
| 368 | + optuna_storage = optuna.storages.JournalStorage(optuna.storages.journal.JournalFileBackend(storage)) # type: ignore[attr-defined] |
371 | 369 | else: |
372 | 370 | optuna_storage = storage # type: ignore[assignment] |
373 | 371 | study = optuna.load_study(storage=optuna_storage, study_name=study_name) |
@@ -892,7 +890,7 @@ def hyperparameters_optimization(self) -> None: |
892 | 890 | # Create folder if it doesn't exist |
893 | 891 | Path(storage).parent.mkdir(parents=True, exist_ok=True) |
894 | 892 | storage = optuna.storages.JournalStorage( # type: ignore[assignment] |
895 | | - optuna.storages.journal.JournalFileBackend(storage), |
| 893 | + optuna.storages.journal.JournalFileBackend(storage), # type: ignore[attr-defined] |
896 | 894 | ) |
897 | 895 |
|
898 | 896 | if self.verbose > 0: |
|
0 commit comments