iglu-contest / gridworld

A reinforcement learning environment for the IGLU 2022 at NeurIPS
GNU Affero General Public License v3.0
32 stars 12 forks source link

Enable use of render method #22

Closed ldfrancis closed 2 years ago

ldfrancis commented 2 years ago

Currently the render method, when called, raises an error; TypeError: render() takes 1 positional argument but 2 were given

This is because the base GridWorld environment does not expect any argument in its render method while gym wrappers have the mode argument by default.

This fix updates the render of gym wrappers to call self.env.render() if the wrapped environment is GridWorld and self.env.render(mode, **kwargs) otherwise.

Also, a bug in the render_size is corrected.