Skip to content

Commit

Permalink
Prepare Release v2.0 (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
araffin authored Jun 23, 2023
1 parent 6e1aba4 commit de92025
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/misc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Changelog
==========

Release 2.0.0a13 (WIP)
Release 2.0.0 (2023-06-22)
--------------------------

**Gymnasium support**
Expand Down
9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ line-length = 127
# Assume Python 3.7
target-version = "py37"
select = ["E", "F", "B", "UP", "C90", "RUF"]
# Ignore explicit stacklevel`
ignore = ["B028"]
# B028: Ignore explicit stacklevel`
# RUF013: Too many false positives (implicit optional)
ignore = ["B028", "RUF013"]

[tool.ruff.per-file-ignores]
# ClassVar, implicit optional check not needed for tests
"./tests/*.py"= ["RUF012", "RUF013"]

[tool.ruff.mccabe]
# Unlike Flake8, ruff default to a complexity level of 10.
Expand Down
4 changes: 2 additions & 2 deletions sb3_contrib/ars/ars.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import time
import warnings
from functools import partial
from typing import Any, Dict, Optional, Type, TypeVar, Union
from typing import Any, ClassVar, Dict, Optional, Type, TypeVar, Union

import numpy as np
import torch as th
Expand Down Expand Up @@ -50,7 +50,7 @@ class ARS(BaseAlgorithm):
:param _init_setup_model: Whether or not to build the network at the creation of the instance
"""

policy_aliases: Dict[str, Type[BasePolicy]] = {
policy_aliases: ClassVar[Dict[str, Type[BasePolicy]]] = {
"MlpPolicy": MlpPolicy,
"LinearPolicy": LinearPolicy,
}
Expand Down
4 changes: 2 additions & 2 deletions sb3_contrib/ppo_mask/ppo_mask.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import time
from collections import deque
from typing import Any, Dict, Optional, Tuple, Type, TypeVar, Union
from typing import Any, ClassVar, Dict, Optional, Tuple, Type, TypeVar, Union

import numpy as np
import torch as th
Expand Down Expand Up @@ -69,7 +69,7 @@ class MaskablePPO(OnPolicyAlgorithm):
:param _init_setup_model: Whether or not to build the network at the creation of the instance
"""

policy_aliases: Dict[str, Type[BasePolicy]] = {
policy_aliases: ClassVar[Dict[str, Type[BasePolicy]]] = {
"MlpPolicy": MlpPolicy,
"CnnPolicy": CnnPolicy,
"MultiInputPolicy": MultiInputPolicy,
Expand Down
4 changes: 2 additions & 2 deletions sb3_contrib/ppo_recurrent/ppo_recurrent.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import time
from copy import deepcopy
from typing import Any, Dict, Optional, Type, TypeVar, Union
from typing import Any, ClassVar, Dict, Optional, Type, TypeVar, Union

import numpy as np
import torch as th
Expand Down Expand Up @@ -67,7 +67,7 @@ class RecurrentPPO(OnPolicyAlgorithm):
:param _init_setup_model: Whether or not to build the network at the creation of the instance
"""

policy_aliases: Dict[str, Type[BasePolicy]] = {
policy_aliases: ClassVar[Dict[str, Type[BasePolicy]]] = {
"MlpLstmPolicy": MlpLstmPolicy,
"CnnLstmPolicy": CnnLstmPolicy,
"MultiInputLstmPolicy": MultiInputLstmPolicy,
Expand Down
4 changes: 2 additions & 2 deletions sb3_contrib/qrdqn/qrdqn.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import warnings
from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar, Union
from typing import Any, ClassVar, Dict, List, Optional, Tuple, Type, TypeVar, Union

import numpy as np
import torch as th
Expand Down Expand Up @@ -60,7 +60,7 @@ class QRDQN(OffPolicyAlgorithm):
:param _init_setup_model: Whether or not to build the network at the creation of the instance
"""

policy_aliases: Dict[str, Type[BasePolicy]] = {
policy_aliases: ClassVar[Dict[str, Type[BasePolicy]]] = {
"MlpPolicy": MlpPolicy,
"CnnPolicy": CnnPolicy,
"MultiInputPolicy": MultiInputPolicy,
Expand Down
4 changes: 2 additions & 2 deletions sb3_contrib/tqc/tqc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, TypeVar, Union
from typing import Any, Callable, ClassVar, Dict, List, Optional, Tuple, Type, TypeVar, Union

import numpy as np
import torch as th
Expand Down Expand Up @@ -68,7 +68,7 @@ class TQC(OffPolicyAlgorithm):
:param _init_setup_model: Whether or not to build the network at the creation of the instance
"""

policy_aliases: Dict[str, Type[BasePolicy]] = {
policy_aliases: ClassVar[Dict[str, Type[BasePolicy]]] = {
"MlpPolicy": MlpPolicy,
"CnnPolicy": CnnPolicy,
"MultiInputPolicy": MultiInputPolicy,
Expand Down
4 changes: 2 additions & 2 deletions sb3_contrib/trpo/trpo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import copy
import warnings
from functools import partial
from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar, Union
from typing import Any, ClassVar, Dict, List, Optional, Tuple, Type, TypeVar, Union

import numpy as np
import torch as th
Expand Down Expand Up @@ -69,7 +69,7 @@ class TRPO(OnPolicyAlgorithm):
:param _init_setup_model: Whether or not to build the network at the creation of the instance
"""

policy_aliases: Dict[str, Type[BasePolicy]] = {
policy_aliases: ClassVar[Dict[str, Type[BasePolicy]]] = {
"MlpPolicy": MlpPolicy,
"CnnPolicy": CnnPolicy,
"MultiInputPolicy": MultiInputPolicy,
Expand Down
2 changes: 1 addition & 1 deletion sb3_contrib/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0a13
2.0.0
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
packages=[package for package in find_packages() if package.startswith("sb3_contrib")],
package_data={"sb3_contrib": ["py.typed", "version.txt"]},
install_requires=[
"stable_baselines3>=2.0.0a13",
"stable_baselines3>=2.0.0",
],
description="Contrib package of Stable Baselines3, experimental code.",
author="Antonin Raffin",
Expand All @@ -82,8 +82,10 @@
project_urls={
"Code": "https://github.com/Stable-Baselines-Team/stable-baselines3-contrib",
"Documentation": "https://sb3-contrib.readthedocs.io/",
"Changelog": "https://stable-baselines3.readthedocs.io/en/master/misc/changelog.html",
"Stable-Baselines3": "https://github.com/DLR-RM/stable-baselines3",
"RL-Zoo": "https://github.com/DLR-RM/rl-baselines3-zoo",
"SBX": "https://github.com/araffin/sbx",
},
classifiers=[
"Programming Language :: Python :: 3",
Expand Down

0 comments on commit de92025

Please sign in to comment.