abaisero / gym-gridverse

Gridworld domains in the gym interface
MIT License
24 stars 7 forks source link

Docs/Installation Cleanup #5

Closed kevslinger closed 2 years ago

kevslinger commented 2 years ago

1.) The Creating Environments Doc page example shows:

import gym
import gym_gridverse

env = gym.make('GridVerse-FourRooms-v0')

but this snippet gives error NameNotFound: Environment GridVerse-FourRooms doesn't exist. Did you mean: GV-Four-rooms-9x9?

But modifying the example to

import gym
import gym_gridverse

env = gym.make('GV-Four-rooms-9x9-v0')

gives error FileNotFoundError: [Errno 2] No such file or directory: '.registered_environments/gv_four_rooms.9x9.yaml' (Note: This error occurs when I use gridverse in a directory other than gridverse itself, of course. But that is my use case. I don't want to be forced to write my run scripts inside an environment repo.)

2.) To fix the doc issue, updating docs/getting-started/creating_environments.rst to replace 'GridVerse-FourRooms-v0' with 'GV-Four-rooms-9x9' should be fine.

For the FileNotFoundError, I was able to hack a solution by updating gym-gridverse/gym.py line 266, from

outer_env_factory, f'.registered_environments/{yaml_filename}'

to

outer_env_factory, os.path.join(os.path.dirname(__file__), "../.registered_environments", yaml_filename)

(Notice this also requires an os import) But this is obviously not elegant and I'm sure there's a better way to do that, so not opening a PR, just wanted to point out the issue.

Very excited to start working with gym-gridverse :D thanks for making a great library

abaisero commented 2 years ago

Registration has been fixed in 7127e5564c073642d83f786516df21fd80132bf8 ; you can use 'GV-Four-rooms-9x9-v0' to load that environment. The documentation will be fixed in an upcoming commit which is rewriting the documentation into a tutorial format.