Skip to content

Commit

Permalink
trying to fix error caused by gymnasium 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BDonnot committed Oct 10, 2024
1 parent 56e904d commit a1fccd3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions grid2op/gym_compat/gymenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ def _aux_step_new(self, gym_action: ActType) -> Tuple[ObsType, float, bool, bool
g2op_obs, reward, terminated, info = self.init_env.step(g2op_act)
gym_obs = self.observation_space.to_gym(g2op_obs)
truncated = False # see https://github.com/openai/gym/pull/2752
if "exception" in info:
info["exception"] = [str(el) for el in info["exception"]]
return gym_obs, float(reward), terminated, truncated, info

def _aux_reset(self,
Expand Down

0 comments on commit a1fccd3

Please sign in to comment.