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

Add action masking documentation, update usage scripts #953

Conversation

elliottower
Copy link
Contributor

@elliottower elliottower commented Apr 23, 2023

Description

This PR makes all usage scripts in documentation consistent and uses break (rather than env.step(None), which I personally feel is a bit confusing for new users).

I also added action masking documentation to the AEC API page.

I changed the homepage usage script to use env.action_space(agent).sample() rather than policy(observation, agent) just because it feels like it's cleaner to have code which actually runs, but I can change that back if we want.

Another consistency thing was I added # execute the action in the environment to the usage because that was in Gymnasium and looks nice to just orient users, I can remove that if we don't like it but I think it's a nice touch.

I decided I think this should be removed from both Gymnasium and this (it was added by a new contributor and made the Gym page a bit cluttered, but it's Mark's call, on my other PR in Gymnasium)

Example screenshot of the new homepage:
firefox_oidtqHRFOF

Action masking documentation:
firefox_l2vwkHpwWB

Fixes # (issue), Depends on # (pull request)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Screenshots

Please attach before and after screenshots of the change if applicable.
To upload images to a PR -- simply drag and drop or copy paste.

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have run pytest -v and no errors are present.
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I solved any possible warnings that pytest -v has generated that are related to my code to the best of my knowledge.
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Member

@jjshoots jjshoots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but since this is documentation, I'd be more confident is someone elsd had a look as well.

@elliottower elliottower requested a review from jkterry1 April 25, 2023 03:43
@elliottower elliottower merged commit 9e8977d into Farama-Foundation:master May 6, 2023
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