Skip to content

Commit

Permalink
Code review fixes DLR-RM#1
Browse files Browse the repository at this point in the history
As suggested by Antonin Raffin <[email protected]>.
  • Loading branch information
lutogniew committed May 25, 2023
1 parent c216f73 commit 5a2cde7
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions tests/test_env_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,7 @@ def step(self, action):
check_env(env=test_env)


class StepCalledAfterEnvTerminatedException(Exception):
pass


class LimitedStepsTestEnv(gym.Env):
metadata = {"render_modes": ["human"]}
render_mode = None

action_space = spaces.Discrete(n=2)
observation_space = spaces.Discrete(n=2)

Expand All @@ -145,8 +138,7 @@ def reset(self, *, seed: Optional[int] = None, options: Optional[Dict] = None) -
def step(self, action: np.ndarray) -> Tuple[int, float, bool, bool, Dict[str, Any]]:
self._steps_called += 1

if self._terminated:
raise StepCalledAfterEnvTerminatedException
assert not self._terminated

observation = 0
reward = 0.0
Expand All @@ -155,10 +147,7 @@ def step(self, action: np.ndarray) -> Tuple[int, float, bool, bool, Dict[str, An

return observation, reward, self._terminated, truncated, {}

def render(self, mode: str = "human") -> None:
pass

def close(self):
def render(self) -> None:
pass


Expand Down

0 comments on commit 5a2cde7

Please sign in to comment.