Farama-Foundation / Minigrid

Simple and easily configurable grid world environments for reinforcement learning
https://minigrid.farama.org/
Other
2.13k stars 610 forks source link

fix rendering and add tests for scripts #219

Closed saleml closed 2 years ago

saleml commented 2 years ago

Description

A warning was raised whenever the render method was called. This PR should fix this. Changes made to this end:

A warning was raised whenever a wrapper was used. This is because even though env.new_step_api=True, Wrapper(env).new_step_api=False by default. A simple fix was to add super().__init__(env, new_step_api=env.new_step_api) in each wrapper's init method.

The benchmark and manual_control now define functions that could be imported (for tests) and a main part that calls these functions when the scripts are run.

Finally, I added a new test file for window.py, benchmark.py and manual_control.py.

Checklist: