Skip to content

Commit

Permalink
Fix linter warnings (order __all__) (#2048)
Browse files Browse the repository at this point in the history
  • Loading branch information
araffin authored Nov 29, 2024
1 parent 8a3e3cc commit 9836692
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion stable_baselines3/a2c/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from stable_baselines3.a2c.a2c import A2C
from stable_baselines3.a2c.policies import CnnPolicy, MlpPolicy, MultiInputPolicy

__all__ = ["CnnPolicy", "MlpPolicy", "MultiInputPolicy", "A2C"]
__all__ = ["A2C", "CnnPolicy", "MlpPolicy", "MultiInputPolicy"]
2 changes: 1 addition & 1 deletion stable_baselines3/common/save_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def open_path(
mode = {"write": "w", "read": "r", "w": "w", "r": "r"}[mode]
except KeyError as e:
raise ValueError("Expected mode to be either 'w' or 'r'.") from e
if ("w" == mode) and not path.writable() or ("r" == mode) and not path.readable():
if (("w" == mode) and not path.writable()) or (("r" == mode) and not path.readable()):
error_msg = "writable" if "w" == mode else "readable"
raise ValueError(f"Expected a {error_msg} file.")
return path
Expand Down
8 changes: 4 additions & 4 deletions stable_baselines3/common/vec_env/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,20 @@ def sync_envs_normalization(env: VecEnv, eval_env: VecEnv) -> None:

__all__ = [
"CloudpickleWrapper",
"VecEnv",
"VecEnvWrapper",
"DummyVecEnv",
"StackedObservations",
"SubprocVecEnv",
"VecCheckNan",
"VecEnv",
"VecEnvWrapper",
"VecExtractDictObs",
"VecFrameStack",
"VecMonitor",
"VecNormalize",
"VecTransposeImage",
"VecVideoRecorder",
"unwrap_vec_wrapper",
"unwrap_vec_normalize",
"is_vecenv_wrapped",
"sync_envs_normalization",
"unwrap_vec_normalize",
"unwrap_vec_wrapper",
]
2 changes: 1 addition & 1 deletion stable_baselines3/ddpg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from stable_baselines3.ddpg.ddpg import DDPG
from stable_baselines3.ddpg.policies import CnnPolicy, MlpPolicy, MultiInputPolicy

__all__ = ["CnnPolicy", "MlpPolicy", "MultiInputPolicy", "DDPG"]
__all__ = ["DDPG", "CnnPolicy", "MlpPolicy", "MultiInputPolicy"]
2 changes: 1 addition & 1 deletion stable_baselines3/dqn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from stable_baselines3.dqn.dqn import DQN
from stable_baselines3.dqn.policies import CnnPolicy, MlpPolicy, MultiInputPolicy

__all__ = ["CnnPolicy", "MlpPolicy", "MultiInputPolicy", "DQN"]
__all__ = ["DQN", "CnnPolicy", "MlpPolicy", "MultiInputPolicy"]
2 changes: 1 addition & 1 deletion stable_baselines3/ppo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from stable_baselines3.ppo.policies import CnnPolicy, MlpPolicy, MultiInputPolicy
from stable_baselines3.ppo.ppo import PPO

__all__ = ["CnnPolicy", "MlpPolicy", "MultiInputPolicy", "PPO"]
__all__ = ["PPO", "CnnPolicy", "MlpPolicy", "MultiInputPolicy"]
2 changes: 1 addition & 1 deletion stable_baselines3/sac/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from stable_baselines3.sac.policies import CnnPolicy, MlpPolicy, MultiInputPolicy
from stable_baselines3.sac.sac import SAC

__all__ = ["CnnPolicy", "MlpPolicy", "MultiInputPolicy", "SAC"]
__all__ = ["SAC", "CnnPolicy", "MlpPolicy", "MultiInputPolicy"]
2 changes: 1 addition & 1 deletion stable_baselines3/td3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from stable_baselines3.td3.policies import CnnPolicy, MlpPolicy, MultiInputPolicy
from stable_baselines3.td3.td3 import TD3

__all__ = ["CnnPolicy", "MlpPolicy", "MultiInputPolicy", "TD3"]
__all__ = ["TD3", "CnnPolicy", "MlpPolicy", "MultiInputPolicy"]

0 comments on commit 9836692

Please sign in to comment.