-
-
Notifications
You must be signed in to change notification settings - Fork 428
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
feature/provide access to wrapped attr #1140
feature/provide access to wrapped attr #1140
Conversation
Looks like a weird error with one of the tests I can take a look at some point if you can’t figure it out. Those tests are a bit wonky because they have variable number of agents and different obs spaces and such (to test things work in those cases) |
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.
Overall looks good just some questions and tests to fix
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.
The changes look like a much needed cleanup to me. Hats off to you for having the balls to handle something potentially lethal as this. That said, I can't figure out why the tests are failing too and have spent whatever bandwidth I have available in solving it. On my local machine, the tests pass 4/5 times but fail for that 1/5 time, so I'm just rerunning tests and hoping for the best unless someone else wants to have a crack at the bug. 💀
There is one bug in the tutorials caused by a SS wrapper. I made a PR there: https://github.com/Farama-Foundation/SuperSuit/pull/235/files. Hopefully fixes this. Regarding the non-deterministic test, @elliottower said he might take a look. I cannot really make sense of the test scenario tbh. |
@pseudo-rnd-thoughts @jjshoots what do you guys think if we instead make this like Gymnasium 1.0 instead of using |
I'm not quite aware of how Gymnasium 1.0 handles it. Could I get a TLDR? |
Farama-Foundation/Gymnasium#535 first point. |
That seems reasonable. I'm not a huge advocate for that idea, especially the whole "anywhere in the wrapper stack" thing, but I reckon lots of discussion has happened over on Gymnasium's end to conclude that that's the best way to do things. For that reason, I think it's OK. As to how painful it will be, probably quite painful. Unlike Gymnasium which has very good in-code documentation, PZ has minimal. Lots of things will break that will require stack dives to fix. Don't get me wrong though, I think this is a worthwhile and needed fix. |
Well to summarize a bit all: This PR introduces the ability to access attributes from the underlying env.
EDIT: I auto-convinced myself of not doing 2. Right now, it seems indeed like quite a lot of changes involved. Let's keep this PR simple and add the feature, plan for the proper Gym-like implementation in the future? |
Yeah makes sense to do it the simple way first then in the future can make it match Gymnasium if need be |
Also I'll have to take a look at the test action mask thing, not sure why it's stochastic seeming but I may just simplify it so the action spaces are always the same or something like that. |
I'm a bit confused by the changes as they don't seem all related to me. |
@pseudo-rnd-thoughts Basically, PZ is transitioning from This is to simplify things like the need to copy termination and truncation signals through all the wrappers. |
Did the SuperSuit release incorporating the wrapper fixes, and looks like the tests pass now. There's an issue with the Ray CI but that's going to be fixed in another PR, so I'm going to merge this. |
Description
This fixes duplicated attributes in base wrapper classes and adds forwards through
__getattr__
inBaseWrapper
. I also made possible to get env-specific attributes throughOrderEnforcing
, which was preventing all API extensions.See: https://discord.com/channels/961771112864313344/1176822393910612038
Note:
conversions.py
are still a mess but it's more difficult to define a getattr since you convert API at the same time... So I left them untouched. It is however possible to retrieve env-specific attributes in converted env by using.unwrapped
.Example
Note2: I don't have the ROM for ALE installed locally so I couldn't run these on my machine.
Type of change
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.