-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Updates the environment checker #2864
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
Updates the environment checker #2864
Conversation
…pendency groups and collects the requirements from requirements.txt to keep everything standardized.
…assive_env_checker.py with a new wrapper env_checker.py
# Conflicts: # setup.py
…only run on the first environment created.
) | ||
|
||
|
||
class PassiveEnvChecker(gym.Wrapper): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why define the Wrapper here and the method implementation in another file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, I think that is because the passive environment checker file has more functions than are used in the wrapper and I use the passive env reset and step check in the full invasive environment checker. So these functions would have to be in a separate place
for mode in render_modes: | ||
env.render(mode=mode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not work anymore with the new Render API.
Initially, I thought to just change the env_checker to receive the environment specification. In this way, internally it can creates as many copies as it needs without touching the copy made for the user. Having the env_spec here will also solve the problem for rendering (and in general for checking the parameters that are passed to__init__
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't totally get what you mean, but as this PR is going to be in the next sub-release, would you be able to make the changes in your render PR?
We are still interested in an environment checker being run on
gym.make
however runningenv_checker
as previously implemented resulted instep
andresest
being called.However, this was found to cause a significant number of issue
Therefore, this PR makes the following upgrades
step
,reset
andrender
to check that the environments follow the gym API specificationstep
orreset
functions but checks the returns data is correct. In addition, passive observation and action space checkers are added and run on initialisation.gym.make
(otherwisedisable_env_checker=True
is passed. This check will run on only the firstreset
,step
andrender
function checking their function signatures, and that data returned. As this wrapper needs direct access to the environment, is it the first wrapper applied to the environment ingym.make
.