Skip to content
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

🔧 Make env picklable #269

Conversation

MathisFederico
Copy link
Contributor

Description

I needed envs to be picklable for using them in multiple process.
Thus I fixed the issue that happens to be lambda functions used for missions generation.

Fixes to fact that envs were not picklable.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (None?)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@MathisFederico MathisFederico changed the title Refactor/make env picklable 🔧 Make env picklable Oct 17, 2022
@rodrigodelazcano
Copy link
Member

Thank you for the PR @MathisFederico. I suggest a few changes. I left a comment for the testing function, and could you update the docs for the MissionSpace class (use static method function instead of lambda function).

Show use of static function instead of lambdas for picklability
@MathisFederico
Copy link
Contributor Author

I suggest a few changes.

Sure ! Where can I find your suggestions ? I don't think you published your review if you have done one !

could you update the docs for the MissionSpace class

Done in last commit !

@rodrigodelazcano
Copy link
Member

Thanks! I just tagged you on it, under tests/test_envs.py

@MathisFederico
Copy link
Contributor Author

MathisFederico commented Oct 17, 2022

Thanks! I just tagged you on it, under tests/test_envs.py

Not sure where to see the tag ... I guess it's on GitHub as I don't see any new commit from your part, but I can't seem to find where you tagged me ^^'

You may want to use GitHub review system, I've had good experiences with that !

tests/test_envs.py Outdated Show resolved Hide resolved
minigrid/minigrid_env.py Outdated Show resolved Hide resolved
@rodrigodelazcano
Copy link
Member

@MathisFederico can you see the review now?

@MathisFederico
Copy link
Contributor Author

Yes ! Sorry I did not have time for now, I may do this tonight if I can find the time !

@MathisFederico
Copy link
Contributor Author

Done ! @rodrigodelazcano

@rodrigodelazcano rodrigodelazcano merged commit 1670d01 into Farama-Foundation:master Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants