-
Notifications
You must be signed in to change notification settings - Fork 62
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
Issue #216: Add envpool to openrl #278
Conversation
@huangshiyu13 I guess the test will pass now without any problem. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #278 +/- ##
==========================================
+ Coverage 69.22% 73.37% +4.15%
==========================================
Files 252 254 +2
Lines 13160 13256 +96
==========================================
+ Hits 9110 9727 +617
+ Misses 4050 3529 -521
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
openrl/envs/common/build_envs.py
Outdated
@@ -36,13 +36,22 @@ def _make_env() -> Env: | |||
new_kwargs["env_num"] = env_num | |||
if id.startswith("ALE/") or id in gym.envs.registry.keys(): | |||
new_kwargs.pop("cfg", None) |
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.
Envpool can not be installed on many platforms (such as Windows), so you should use the envpool as an external env which is out of OpenRL. Moreover, with the envpool as an external env, you don't need to write test code for codecov, because we only track the code in the openrl folder.
Examples:
openrl/envs/common/build_envs.py
Outdated
) | ||
if "envpool" in new_kwargs: | ||
# for now envpool doesnt support any render mode | ||
# envpool also doesnt stores the id anywhere |
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.
Envpool can not be installed on many platforms (such as Windows), so you should use the envpool as an external env which is out of OpenRL. Moreover, with the envpool as an external env, you don't need to write test code for codecov, because we only track the code in the openrl folder.
Examples:
openrl/envs/common/registration.py
Outdated
@@ -17,6 +17,7 @@ | |||
"""""" | |||
from typing import Callable, Optional | |||
|
|||
import envpool |
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.
Envpool can not be installed on many platforms (such as Windows), so you should use the envpool as an external env which is out of OpenRL. Moreover, with the envpool as an external env, you don't need to write test code for codecov, because we only track the code in the openrl folder.
Examples:
openrl/envs/common/registration.py
Outdated
@@ -155,6 +155,18 @@ def make( | |||
env_fns = make_PettingZoo_envs( | |||
id=id, env_num=env_num, render_mode=convert_render_mode, **kwargs | |||
) | |||
elif ( | |||
"envpool:" in id |
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.
Envpool can not be installed on many platforms (such as Windows), so you should use the envpool as an external env which is out of OpenRL. Moreover, with the envpool as an external env, you don't need to write test code for codecov, because we only track the code in the openrl folder.
Examples:
openrl/envs/common/registration.py
Outdated
): | ||
from openrl.envs.envpool import make_envpool_envs | ||
|
||
env_fns = make_envpool_envs( |
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.
Envpool can not be installed on many platforms (such as Windows), so you should use the envpool as an external env which is out of OpenRL. Moreover, with the envpool as an external env, you don't need to write test code for codecov, because we only track the code in the openrl folder.
Examples:
openrl/envs/envpool/__init__.py
Outdated
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.
should move to examples/envpool
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.
should move to examples/envpool
setup.py
Outdated
@@ -84,6 +85,7 @@ def get_extra_requires() -> dict: | |||
"fastapi", | |||
"pettingzoo[mpe]", | |||
"pettingzoo[butterfly]", | |||
"envpool", |
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.
delete this. Add a README.md in examples/envpool. And show how to install dependencies in the markdown.
setup.py
Outdated
@@ -76,6 +76,7 @@ def get_extra_requires() -> dict: | |||
"async_timeout", | |||
"pettingzoo[classic]", | |||
"trueskill", | |||
"envpool", |
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.
delete this. Add a README.md in examples/envpool. And show how to install dependencies in the markdown.
Description
This PR adds envpool to openrl (#216).
Warning: I havent done
make format
(will do it later) because I am not sure about why the test fails.Types of changes
Checklist
make test
pass (required).make format
(required).