Skip to content

Commit 1e19436

Browse files
committed
Reformat and fix mypy issues
1 parent cd25d31 commit 1e19436

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

rl_zoo3/exp_manager.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
import time
77
import warnings
88
from collections import OrderedDict
9+
from collections.abc import Callable
910
from pathlib import Path
1011
from pprint import pprint
1112
from typing import Any
12-
from collections.abc import Callable
1313

1414
import gymnasium as gym
1515
import numpy as np
@@ -362,12 +362,10 @@ def read_hyperparameters(self) -> tuple[dict[str, Any], dict[str, Any]]:
362362

363363
return hyperparams, saved_hyperparams
364364

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]:
368366

369367
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]
371369
else:
372370
optuna_storage = storage # type: ignore[assignment]
373371
study = optuna.load_study(storage=optuna_storage, study_name=study_name)
@@ -892,7 +890,7 @@ def hyperparameters_optimization(self) -> None:
892890
# Create folder if it doesn't exist
893891
Path(storage).parent.mkdir(parents=True, exist_ok=True)
894892
storage = optuna.storages.JournalStorage( # type: ignore[assignment]
895-
optuna.storages.journal.JournalFileBackend(storage),
893+
optuna.storages.journal.JournalFileBackend(storage), # type: ignore[attr-defined]
896894
)
897895

898896
if self.verbose > 0:

rl_zoo3/import_envs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from typing import Optional
21
from collections.abc import Callable
2+
from typing import Optional
33

44
import gymnasium as gym
55
from gymnasium.envs.registration import register, register_envs

rl_zoo3/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import glob
33
import importlib
44
import os
5+
from collections.abc import Callable
56
from copy import deepcopy
67
from typing import Any
7-
from collections.abc import Callable
88

99
import gymnasium as gym
1010
import stable_baselines3 as sb3 # noqa: F401

0 commit comments

Comments
 (0)