-
Notifications
You must be signed in to change notification settings - Fork 21
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
EzPickle support #50
EzPickle support #50
Conversation
@pseudo-rnd-thoughts says this shouldn't be necessary, going to change this PR to add testing that the ezpickle functionality works as properly |
I should clarify what I mean. @elliottower @jkterry1
It is helpful for users to save the state of an environment or to duplicate an environment, this is often done using It is important to note that this does not perfectly recreate an object as if an object has an updated as
|
This is why we have pickle _or_ ezpickle in the standards
…On Tue, Mar 28, 2023 at 5:40 AM Mark Towers ***@***.***> wrote:
@pseudo-rnd-thoughts <https://github.com/pseudo-rnd-thoughts> says this
shouldn't be necessary, going to change this PR to add testing that the
ezpickle functionality works as properly
I should clarify what I mean. @elliottower
<https://github.com/elliottower> @jkterry1 <https://github.com/jkterry1>
Why is EzPickle used?
It is helpful for users to save the state of an environment or to
duplicate an environment, this is often done using pickle, i.e.,
pickle.load(pickle.dump(env)).
However, pickle is unable to understand non-python code without explicit
__getstate__ or __setstate functions. This is where EzPickle comes in.
For objects that are unable to be pickled, then EzPickle implements
__getstate__ and __setstate__ functions to recreate the object using the
arguments passed to the constructor.
It is important to note that this does not perfectly recreate an object as
if an object has an updated as EzPickle does not account for this.
When should EzPickle be used in gymnasium, pettingzoo and other
respective projects
EzPickle should only be used when an environment uses external modules
that use non-python code, i.e., mujoco and ale. In these cases and only
these cases then EzPickle should be added to the environment in which all
of the environment constructor parameters should be passed to EzPickle.
EzPickle should be used sparingly and only when necessary and is not an
apply to all environments type of solution as this can break backwards
compatibility.
—
Reply to this email directly, view it on GitHub
<#50 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEUF33FOBRNHC6W6KK26DPLW6KWZNANCNFSM6AAAAAAWJWQURU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The standards don't include this https://farama.org/project_standards |
Closing this in favor of #53 |
Description
Updated all environments to support EzPickle (similar to Farama-Foundation/PettingZoo#924)
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.