Skip to content

Commit c070fc2

Browse files
authored
Release 2.5.0 (#271)
* Release 2.5.0 * Ignore mypy errors
1 parent e1ca24a commit c070fc2

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

docs/misc/changelog.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
Changelog
44
==========
55

6-
Release 2.5.0a0 (WIP)
6+
Release 2.5.0 (2025-01-27)
77
--------------------------
88

99
Breaking Changes:
1010
^^^^^^^^^^^^^^^^^
1111
- Upgraded to PyTorch 2.3.0
1212
- Dropped Python 3.8 support
13+
- Upgraded to Stable-Baselines3 >= 2.5.0
1314

1415
New Features:
1516
^^^^^^^^^^^^^

sb3_contrib/common/envs/invalid_actions_env.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,17 @@ def __init__(
2222

2323
space = spaces.Discrete(dim)
2424
self.n_invalid_actions = n_invalid_actions
25-
self.possible_actions = np.arange(space.n)
25+
self.possible_actions = np.arange(space.n, dtype=int)
2626
self.invalid_actions: list[int] = []
2727
super().__init__(space=space, ep_length=ep_length)
2828

2929
def _choose_next_state(self) -> None:
3030
self.state = self.action_space.sample()
3131
# Randomly choose invalid actions that are not the current state
3232
potential_invalid_actions = [i for i in self.possible_actions if i != self.state]
33-
self.invalid_actions = np.random.choice(potential_invalid_actions, self.n_invalid_actions, replace=False).tolist()
33+
self.invalid_actions = np.random.choice( # type: ignore[assignment]
34+
potential_invalid_actions, self.n_invalid_actions, replace=False
35+
).tolist()
3436

3537
def action_masks(self) -> list[bool]:
3638
return [action not in self.invalid_actions for action in self.possible_actions]
@@ -72,7 +74,9 @@ def _choose_next_state(self) -> None:
7274

7375
# Randomly choose invalid actions that are not the current state
7476
potential_invalid_actions = [i for i in self.possible_actions if i not in converted_state]
75-
self.invalid_actions = np.random.choice(potential_invalid_actions, self.n_invalid_actions, replace=False).tolist()
77+
self.invalid_actions = np.random.choice( # type: ignore[assignment]
78+
potential_invalid_actions, self.n_invalid_actions, replace=False
79+
).tolist()
7680

7781
def action_masks(self) -> list[bool]:
7882
return [action not in self.invalid_actions for action in self.possible_actions]
@@ -113,7 +117,9 @@ def _choose_next_state(self) -> None:
113117

114118
# Randomly choose invalid actions that are not the current state
115119
potential_invalid_actions = [i for i in self.possible_actions if i not in converted_state]
116-
self.invalid_actions = np.random.choice(potential_invalid_actions, self.n_invalid_actions, replace=False).tolist()
120+
self.invalid_actions = np.random.choice( # type: ignore[assignment]
121+
potential_invalid_actions, self.n_invalid_actions, replace=False
122+
).tolist()
117123

118124
def action_masks(self) -> list[bool]:
119125
return [action not in self.invalid_actions for action in self.possible_actions]

sb3_contrib/common/maskable/callbacks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def _on_step(self) -> bool:
8484
timesteps=self.evaluations_timesteps,
8585
results=self.evaluations_results,
8686
ep_lengths=self.evaluations_length,
87-
**kwargs,
87+
**kwargs, # type: ignore[arg-type]
8888
)
8989

9090
mean_reward, std_reward = np.mean(episode_rewards), np.std(episode_rewards)

sb3_contrib/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.5.0a0
1+
2.5.0

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
packages=[package for package in find_packages() if package.startswith("sb3_contrib")],
6868
package_data={"sb3_contrib": ["py.typed", "version.txt"]},
6969
install_requires=[
70-
"stable_baselines3>=2.4.0,<3.0",
70+
"stable_baselines3>=2.5.0,<3.0",
7171
],
7272
description="Contrib package of Stable Baselines3, experimental code.",
7373
author="Antonin Raffin",

0 commit comments

Comments
 (0)