diff --git a/stable_baselines3/a2c/__init__.py b/stable_baselines3/a2c/__init__.py index 78fc54fb1..67f58df35 100644 --- a/stable_baselines3/a2c/__init__.py +++ b/stable_baselines3/a2c/__init__.py @@ -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"] diff --git a/stable_baselines3/common/save_util.py b/stable_baselines3/common/save_util.py index 8b545f898..3da23451b 100644 --- a/stable_baselines3/common/save_util.py +++ b/stable_baselines3/common/save_util.py @@ -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 diff --git a/stable_baselines3/common/vec_env/__init__.py b/stable_baselines3/common/vec_env/__init__.py index 9a60c07dc..ac49a0469 100644 --- a/stable_baselines3/common/vec_env/__init__.py +++ b/stable_baselines3/common/vec_env/__init__.py @@ -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", ] diff --git a/stable_baselines3/ddpg/__init__.py b/stable_baselines3/ddpg/__init__.py index 257a3e3a5..6071aaad4 100644 --- a/stable_baselines3/ddpg/__init__.py +++ b/stable_baselines3/ddpg/__init__.py @@ -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"] diff --git a/stable_baselines3/dqn/__init__.py b/stable_baselines3/dqn/__init__.py index 2e5e2db96..006b6dc0a 100644 --- a/stable_baselines3/dqn/__init__.py +++ b/stable_baselines3/dqn/__init__.py @@ -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"] diff --git a/stable_baselines3/ppo/__init__.py b/stable_baselines3/ppo/__init__.py index cd91257b5..068347b00 100644 --- a/stable_baselines3/ppo/__init__.py +++ b/stable_baselines3/ppo/__init__.py @@ -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"] diff --git a/stable_baselines3/sac/__init__.py b/stable_baselines3/sac/__init__.py index bdf780d43..b4fd59ebe 100644 --- a/stable_baselines3/sac/__init__.py +++ b/stable_baselines3/sac/__init__.py @@ -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"] diff --git a/stable_baselines3/td3/__init__.py b/stable_baselines3/td3/__init__.py index 428141e5c..efdfc9fa8 100644 --- a/stable_baselines3/td3/__init__.py +++ b/stable_baselines3/td3/__init__.py @@ -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"]