-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Update testing #946
Update testing #946
Conversation
So I've been poking around at this, it appears that
The solution here is to simply:
|
Note: looking at rlcard base, it seems that even if an env uses np float64 it gets recast to float32, so I decided to keep my original change making the observation space float32 (which also caused the tests not to fail) |
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.
Sorry, but some last final knitpicks, but otherwise golden.
Description
Splitting #933 into separate PRs for simplicity.
This PR rewrites the seed test to actually check that environment rollouts are the same, matching gymnasium. It also updates the API test to handle dict observations, and fixes the variable env test which fails under the new seed test code.
The previous seed test used hashing to check that observations and rewards were consistent, but was nearly impossible to debug (all you see are hash values), not comprehensive (didn't check for many things like info matching, agents being the same, etc) and generally very confusing/messy code. The only reason waterworld passed previously was that the seeds used were 0,1,2, whereas seed 42 which I use (same as gymnasium/shimmy) exposed underlying issues in the environment. I'm keeping the seed at 42 and disabling the waterworld seed test, so it is documented and the bug can be tested and fixed in the future.
It also fixes a bug in one environment where obs and obs space don't match.
Fixes # (issue), Depends on # (pull request)
Type of change
Screenshots
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.