-
-
Notifications
You must be signed in to change notification settings - Fork 465
Update new Render API #800
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
Conversation
# Conflicts: # pettingzoo/mpe/_mpe_utils/simple_env.py
# Conflicts: # docs/content/basic_usage.md # pettingzoo/classic/rlcard_envs/gin_rummy.py # pettingzoo/classic/rlcard_envs/leduc_holdem.py # pettingzoo/classic/tictactoe/tictactoe.py
jjshoots
left a comment
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.
Almost LGTM so far, other than some of the comments I've left.
I think self.render_mode and possibly the warning can be moved into env.py itself, this would remove a lot of clutter from the many environment files.
jjshoots
left a comment
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.
LGTM now, if @WillDudley is happy with this then I think we can merge. (Possibly after the clarification needed from Mark)
WillDudley
left a comment
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.
lgtm :)
I've pinged Ben on Discord asking for his sanity check on the r_env revision if he has time, but nonetheless I approve the merge. If Ben notices we've misinterpreted it we can easily hotfix it.
|
Cool, @younik could you fix |
|
Looking at the r_env thing, it looks necessary to me: Note the code path:
It should work (note that the code was written before the |
|
Thanks, @benblack769, it makes sense! With this PR, I also added a custom implementation of from pettingzoo.classic.hanabi_v4 import raw_env
from pettingzoo.classic.hanabi.hanabi import HanabiScorePenalty
from pettingzoo.utils import wrappers
env = raw_env(render_mode="human")
env = wrappers.CaptureStdoutWrapper(env)
env = HanabiScorePenalty(env)
float(env)@jjshoots I fixed pre-commit. |
| def __getattr__(self, name): | ||
| """Returns an attribute with ``name``, unless ``name`` starts with an underscore.""" | ||
| if name.startswith("_"): | ||
| raise AttributeError(f"accessing private attribute '{name}' is prohibited") | ||
| return getattr(self.env, name) | ||
|
|
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.
@benblack769 for reference
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.
I wouldn't add it casually in the middle of a big PR like this, its worth thinking over whether this plays nicely with the conversion wrappers, with the parallel wrappers, with the OrderEnforcing wrapper which has its own __getattr__ overload, etc.
PZ has somewhat more complex wrapper system than gym.
That being said, I think people have converted me over to the concept that this is a good idea.
|
Personally I don't quite follow this. Why does adding an attribute error for hidden attributes negate the need for |
|
It's not the error that negates the need for unwrapped, it's the |
|
Ah, I see, lgtm then. Merge? |
|
I'm waiting to see if @benblack769 has anything to say about that new getattr. |
|
@benblack769 Could you have a look at that getattr thing and see if it's reasonable? |
|
Thanks for the help everyone! Merging since I think everything's sound. |
|
Hi there, a lot of people complain about the API changes you have made. Is there a decent solution to address those issues? |
Hello, I explained the changes and how to update environments here: https://younis.dev/blog/render-api/ |
|
We also have a tutorial but it needs some minor bugfixes which I don't have capacity to do. The tutorials can be found here: https://github.com/Farama-Foundation/PettingZoo/tree/master/tutorials/Tianshou @Trinkle23897 It would help if you could take a look at them, otherwise I'll find someone to delegate the task to. I'll also bump up the task priority, I wasn't aware of the complaints. |
|
It would be nice if someone can address this issue! |
|
We've upped the priority on the tutorial |
Update to new Render API openai/gym#2671
Todo:
humanrendering automatic