mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-07-29 20:14:17 +00:00
Exposed modules in __init__.py with __all__ (#1195)
* Exposed modules in __init__.py with __all__ * Remove flake8 ignore and update root __all__ * Update version Co-authored-by: Antonin Raffin <antonin.raffin@ensta.org>
This commit is contained in:
parent
b46396a664
commit
852d635742
13 changed files with 63 additions and 15 deletions
|
|
@ -4,7 +4,7 @@ Changelog
|
|||
==========
|
||||
|
||||
|
||||
Release 1.7.0a4 (WIP)
|
||||
Release 1.7.0a5 (WIP)
|
||||
--------------------------
|
||||
|
||||
Breaking Changes:
|
||||
|
|
@ -43,6 +43,7 @@ Others:
|
|||
- Fixed ``tests/test_distributions.py`` type hint
|
||||
- Fixed ``stable_baselines3/common/type_aliases.py`` type hint
|
||||
- Fixed ``stable_baselines3/common/env_util.py`` type hint
|
||||
- Exposed modules in ``__init__.py`` with the ``__all__`` attribute (@ZikangXiong)
|
||||
|
||||
Documentation:
|
||||
^^^^^^^^^^^^^^
|
||||
|
|
@ -1126,4 +1127,4 @@ And all the contributors:
|
|||
@simoninithomas @armandpl @manuel-delverme @Gautam-J @gianlucadecola @buoyancy99 @caburu @xy9485
|
||||
@Gregwar @ycheng517 @quantitative-technologies @bcollazo @git-thor @TibiGG @cool-RR @MWeltevrede
|
||||
@Melanol @qgallouedec @francescoluciano @jlp-ue @burakdmb @timothe-chaumont @honglu2875
|
||||
@anand-bala @hughperkins @sidney-tio @AlexPasqua @dominicgkerr @Akhilez @Rocamonde @tobirohrer
|
||||
@anand-bala @hughperkins @sidney-tio @AlexPasqua @dominicgkerr @Akhilez @Rocamonde @tobirohrer @ZikangXiong
|
||||
|
|
|
|||
11
setup.cfg
11
setup.cfg
|
|
@ -81,17 +81,6 @@ exclude = (?x)(
|
|||
ignore = W503,W504,E203,E231
|
||||
# Ignore import not used when aliases are defined
|
||||
per-file-ignores =
|
||||
./stable_baselines3/__init__.py:F401
|
||||
./stable_baselines3/common/__init__.py:F401
|
||||
./stable_baselines3/common/envs/__init__.py:F401
|
||||
./stable_baselines3/a2c/__init__.py:F401
|
||||
./stable_baselines3/ddpg/__init__.py:F401
|
||||
./stable_baselines3/dqn/__init__.py:F401
|
||||
./stable_baselines3/her/__init__.py:F401
|
||||
./stable_baselines3/ppo/__init__.py:F401
|
||||
./stable_baselines3/sac/__init__.py:F401
|
||||
./stable_baselines3/td3/__init__.py:F401
|
||||
./stable_baselines3/common/vec_env/__init__.py:F401
|
||||
# Default implementation in abstract methods
|
||||
./stable_baselines3/common/callbacks.py:B027
|
||||
./stable_baselines3/common/noise.py:B027
|
||||
|
|
|
|||
|
|
@ -20,3 +20,15 @@ def HER(*args, **kwargs):
|
|||
"Since Stable Baselines 2.1.0, `HER` is now a replay buffer class `HerReplayBuffer`.\n "
|
||||
"Please check the documentation for more information: https://stable-baselines3.readthedocs.io/"
|
||||
)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"A2C",
|
||||
"DDPG",
|
||||
"DQN",
|
||||
"PPO",
|
||||
"SAC",
|
||||
"TD3",
|
||||
"HerReplayBuffer",
|
||||
"get_system_info",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,2 +1,4 @@
|
|||
from stable_baselines3.a2c.a2c import A2C
|
||||
from stable_baselines3.a2c.policies import CnnPolicy, MlpPolicy, MultiInputPolicy
|
||||
|
||||
__all__ = ["CnnPolicy", "MlpPolicy", "MultiInputPolicy", "A2C"]
|
||||
|
|
|
|||
|
|
@ -7,3 +7,14 @@ from stable_baselines3.common.envs.identity_env import (
|
|||
IdentityEnvMultiDiscrete,
|
||||
)
|
||||
from stable_baselines3.common.envs.multi_input_envs import SimpleMultiObsEnv
|
||||
|
||||
__all__ = [
|
||||
"BitFlippingEnv",
|
||||
"FakeImageEnv",
|
||||
"IdentityEnv",
|
||||
"IdentityEnvBox",
|
||||
"IdentityEnvMultiBinary",
|
||||
"IdentityEnvMultiDiscrete",
|
||||
"SimpleMultiObsEnv",
|
||||
"SimpleMultiObsEnv",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
# flake8: noqa F401
|
||||
import typing
|
||||
from copy import deepcopy
|
||||
from typing import Optional, Type, Union
|
||||
|
|
@ -72,3 +71,25 @@ def sync_envs_normalization(env: "GymEnv", eval_env: "GymEnv") -> None:
|
|||
eval_env_tmp.ret_rms = deepcopy(env_tmp.ret_rms)
|
||||
env_tmp = env_tmp.venv
|
||||
eval_env_tmp = eval_env_tmp.venv
|
||||
|
||||
|
||||
__all__ = [
|
||||
"CloudpickleWrapper",
|
||||
"VecEnv",
|
||||
"VecEnvWrapper",
|
||||
"DummyVecEnv",
|
||||
"StackedDictObservations",
|
||||
"StackedObservations",
|
||||
"SubprocVecEnv",
|
||||
"VecCheckNan",
|
||||
"VecExtractDictObs",
|
||||
"VecFrameStack",
|
||||
"VecMonitor",
|
||||
"VecNormalize",
|
||||
"VecTransposeImage",
|
||||
"VecVideoRecorder",
|
||||
"unwrap_vec_wrapper",
|
||||
"unwrap_vec_normalize",
|
||||
"is_vecenv_wrapped",
|
||||
"sync_envs_normalization",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,2 +1,4 @@
|
|||
from stable_baselines3.ddpg.ddpg import DDPG
|
||||
from stable_baselines3.ddpg.policies import CnnPolicy, MlpPolicy, MultiInputPolicy
|
||||
|
||||
__all__ = ["CnnPolicy", "MlpPolicy", "MultiInputPolicy", "DDPG"]
|
||||
|
|
|
|||
|
|
@ -1,2 +1,4 @@
|
|||
from stable_baselines3.dqn.dqn import DQN
|
||||
from stable_baselines3.dqn.policies import CnnPolicy, MlpPolicy, MultiInputPolicy
|
||||
|
||||
__all__ = ["CnnPolicy", "MlpPolicy", "MultiInputPolicy", "DQN"]
|
||||
|
|
|
|||
|
|
@ -1,2 +1,4 @@
|
|||
from stable_baselines3.her.goal_selection_strategy import GoalSelectionStrategy
|
||||
from stable_baselines3.her.her_replay_buffer import HerReplayBuffer
|
||||
|
||||
__all__ = ["GoalSelectionStrategy", "HerReplayBuffer"]
|
||||
|
|
|
|||
|
|
@ -1,2 +1,4 @@
|
|||
from stable_baselines3.ppo.policies import CnnPolicy, MlpPolicy, MultiInputPolicy
|
||||
from stable_baselines3.ppo.ppo import PPO
|
||||
|
||||
__all__ = ["CnnPolicy", "MlpPolicy", "MultiInputPolicy", "PPO"]
|
||||
|
|
|
|||
|
|
@ -1,2 +1,4 @@
|
|||
from stable_baselines3.sac.policies import CnnPolicy, MlpPolicy, MultiInputPolicy
|
||||
from stable_baselines3.sac.sac import SAC
|
||||
|
||||
__all__ = ["CnnPolicy", "MlpPolicy", "MultiInputPolicy", "SAC"]
|
||||
|
|
|
|||
|
|
@ -1,2 +1,4 @@
|
|||
from stable_baselines3.td3.policies import CnnPolicy, MlpPolicy, MultiInputPolicy
|
||||
from stable_baselines3.td3.td3 import TD3
|
||||
|
||||
__all__ = ["CnnPolicy", "MlpPolicy", "MultiInputPolicy", "TD3"]
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
1.7.0a4
|
||||
1.7.0a5
|
||||
|
|
|
|||
Loading…
Reference in a new issue