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

Missing some keys when using GymEnv #281

Closed
BDonnot opened this issue Jan 25, 2022 · 0 comments · Fixed by #309
Closed

Missing some keys when using GymEnv #281

BDonnot opened this issue Jan 25, 2022 · 0 comments · Fixed by #309
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@BDonnot
Copy link
Collaborator

BDonnot commented Jan 25, 2022

Environment

  • Grid2op version: 1.6.5
  • System: all
  • Additional system information

Bug description

When setting the action class to be CompleteAction we cannot use the GymEnv because of some missing keys.

How to reproduce

Just run this in a python repl:

import grid2op
from grid2op.Action import CompleteAction
from grid2op.gym_compat import GymEnv

if __name__ == "__main__":
    env = grid2op.make("educ_case14_storage",
                        test=True,
                        action_class=CompleteAction)

    env_gym = GymEnv(env)

Current output

Traceback (most recent call last):
  File "test_box_act copy.py", line 15, in <module>
    env_gym = GymEnv(env)
  File "grid2op/gym_compat/gymenv.py", line 45, in __init__
    self.action_space = GymActionSpace(self.init_env)
  File "/grid2op/gym_compat/gym_act_space.py", line 138, in __init__
    dict_ = self._fix_dict_keys(dict_)
  File "/grid2op/gym_compat/gym_act_space.py", line 273, in _fix_dict_keys
    res[self.keys_grid2op_2_human[k]] = v
KeyError: 'shunt_p'

Expected output

No error expected
@BDonnot BDonnot added bug Something isn't working good first issue Good for newcomers labels Jan 25, 2022
BDonnot referenced this issue in BDonnot/Grid2Op Jan 25, 2022
@BDonnot BDonnot mentioned this issue Jan 27, 2022
@BDonnot BDonnot linked a pull request Apr 29, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant