Skip to content

Commit

Permalink
Update changelog and black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ReHoss committed Jul 13, 2023
1 parent b8eda9e commit 30e8107
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/misc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Breaking Changes:
New Features:
^^^^^^^^^^^^^
- Added Python 3.11 support
- Add options argument to pass to `env.reset()`. Same as seeds logic, options are reset at the end of an episode (@ReHoss)

`SB3-Contrib`_
^^^^^^^^^^^^^^
Expand Down Expand Up @@ -1395,4 +1396,4 @@ And all the contributors:
@Melanol @qgallouedec @francescoluciano @jlp-ue @burakdmb @timothe-chaumont @honglu2875
@anand-bala @hughperkins @sidney-tio @AlexPasqua @dominicgkerr @Akhilez @Rocamonde @tobirohrer @ZikangXiong
@DavyMorgan @luizapozzobon @Bonifatius94 @theSquaredError @harveybellini @DavyMorgan @FieteO @jonasreiher @npit @WeberSamuel @troiganto
@lutogniew @lbergmann1 @lukashass
@lutogniew @lbergmann1 @lukashass @ReHoss
4 changes: 3 additions & 1 deletion stable_baselines3/common/vec_env/base_vec_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ def set_options(self, options: Optional[Dict] = None) -> None:
"""
if options is None:
options = {}
self._options = [options,] * self.num_envs
self._options = [
options,
] * self.num_envs
return self._options

@property
Expand Down
5 changes: 3 additions & 2 deletions stable_baselines3/common/vec_env/dummy_vec_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ def step_wait(self) -> VecEnvStepReturn:

def reset(self) -> VecEnvObs:
for env_idx in range(self.num_envs):
obs, self.reset_infos[env_idx] = self.envs[env_idx].reset(seed=self._seeds[env_idx],
options=self._options[env_idx])
obs, self.reset_infos[env_idx] = self.envs[env_idx].reset(
seed=self._seeds[env_idx], options=self._options[env_idx]
)
self._save_obs(env_idx, obs)
# Seeds and options are only used once
self._reset_seeds()
Expand Down

0 comments on commit 30e8107

Please sign in to comment.