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

Issue #216: Add envpool to openrl #278

Merged
merged 6 commits into from
Dec 20, 2023
Merged

Conversation

kingjuno
Copy link
Collaborator

@kingjuno kingjuno commented Dec 7, 2023

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

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

Checklist

  • I have ensured make test pass (required).
  • I have checked the code using make format (required).

@kingjuno
Copy link
Collaborator Author

kingjuno commented Dec 7, 2023

image
Strange! I can see all tests are passing in my local.

@kingjuno
Copy link
Collaborator Author

kingjuno commented Dec 7, 2023

@huangshiyu13 I guess the test will pass now without any problem.

Copy link

codecov bot commented Dec 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9a05e6f) 69.22% compared to head (693d2e1) 73.37%.
Report is 20 commits behind head on main.

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     
Flag Coverage Δ
unittests 73.37% <100.00%> (+4.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -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)
Copy link
Member

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:

)
if "envpool" in new_kwargs:
# for now envpool doesnt support any render mode
# envpool also doesnt stores the id anywhere
Copy link
Member

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:

@@ -17,6 +17,7 @@
""""""
from typing import Callable, Optional

import envpool
Copy link
Member

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:

@@ -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
Copy link
Member

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:

):
from openrl.envs.envpool import make_envpool_envs

env_fns = make_envpool_envs(
Copy link
Member

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:

Copy link
Member

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

Copy link
Member

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",
Copy link
Member

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",
Copy link
Member

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.

@huangshiyu13 huangshiyu13 merged commit e864a08 into OpenRL-Lab:main Dec 20, 2023
5 checks passed
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