-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
Add pickling tests, adapt all envs to be picklable #928
Add pickling tests, adapt all envs to be picklable #928
Conversation
Do we care if rendered pygame envs can be pickled? Currently they all work with render_mode=None but with pygame rendering there are some issues like chess has a pygame.time.Clock object which can't be pickled. Could add EzPickle to that file but it's a bit weird to do that as it's all python and I don't imagine people will try to pickle rendered envs. When you load an env which has been pickled and uses pygame it also doesn't have the video system initialized, as the pygame.init() call is in the constructor rather than in reset(). |
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.
Repeat comments for the second class
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.
With the changes, looks good
Description
This PR adds tests to check that each environment can be saved and loaded via pickling. Waterworld and mpe simple envs both have pygame objects (pygame.Clock and pygame Surface, respectively) and cannot be pickled without EzPickle. I have removed the changes I made to version numbers and other miscellaneous changes to make this PR as simple as possible.
Previous comments:
Fixes # (issue), Depends on # (pull request)
Type of change
Screenshots
Checklist:
pre-commit
checks withpre-commit run --all-files
(seeCONTRIBUTING.md
instructions to set it up)pytest -v
and no errors are present.pytest -v
has generated that are related to my code to the best of my knowledge.