Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove FloatReward #829

Merged
merged 3 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def get_local_version(version: "ScmVersion", time_format="%Y%m%d") -> str:
"rich",
"scikit-learn>=0.21.2",
"seals~=0.2.1",
"stable-baselines3~=2.0",
"stable-baselines3~=2.2.1",
"sacred>=0.8.4",
"tensorboard>=1.14",
"huggingface_sb3~=3.0",
Expand Down
11 changes: 0 additions & 11 deletions tests/algorithms/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Fixtures common across algorithm tests."""
from typing import Sequence

import gymnasium as gym
import pytest
from stable_baselines3.common import envs
from stable_baselines3.common.policies import BasePolicy
Expand Down Expand Up @@ -113,20 +112,10 @@ def pendulum_single_venv(rng) -> VecEnv:
)


# TODO(GH#794): Remove after https://github.com/DLR-RM/stable-baselines3/pull/1676
# merged and released.
class FloatReward(gym.RewardWrapper):
"""Typecasts reward to a float."""

def reward(self, reward):
return float(reward)


@pytest.fixture
def multi_obs_venv() -> VecEnv:
def make_env():
env = envs.SimpleMultiObsEnv(channel_last=False)
env = FloatReward(env)
return RolloutInfoWrapper(env)

return DummyVecEnv([make_env, make_env])
Loading