-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
Wrappers doctests #1083
Merged
elliottower
merged 28 commits into
Farama-Foundation:master
from
elliottower:wrappers-doctests
Sep 4, 2023
Merged
Wrappers doctests #1083
elliottower
merged 28 commits into
Farama-Foundation:master
from
elliottower:wrappers-doctests
Sep 4, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…pdate docs slightly
…t for checking md docs
7 tasks
…es from env docs (don't include import)
…ins, now 155 test roughly 6x)
…ins, now 155 test roughly 6x)
… artifact failing if not found
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds testing to ensure that all of the examples used in our documentation work correctly as intended.
The workflow even complies the environment MD pages, and runs tests on those--which allows us to validate that every single usage example shown on the website will run without errors (the script also ensures that the same base
usage_aec
andusage_parallel
skeletons are used for each env page, so things are easier to maintain and keep consistent). Previously the script was impossible to test with pytest as they were markdown files embedded, but this solves that problem.In doing these checks, I uncovered a wide variety of other issues which I then fixed (maybe not ideal to put them in the same PR, but I'm limited in bandwidth so this is the best I can do currently).
One such change is adding assertions to each of the PettingZoo included wrappers to ensure that they are only used on AECEnvs, as they inherit the base env class and are not functionally able to handle parallel envs, but it was still possible to wrap parallel envs--with incorrect behavior. I would like to make the wrappers work with both envs in the future, but the code as is currently does not.
Edit:
I have also included a yml formatter pre commit hook, and added some functionality for using pytest split and saving durations for the docs tests because they run quite slowly.
TODO for the future:
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.