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

Added ActionSpaceConfig #25

Merged
merged 2 commits into from
Mar 8, 2023

Conversation

ppasupat
Copy link
Collaborator

@ppasupat ppasupat commented Mar 6, 2023

Description

Added ActionSpaceConfig for custom action spaces.

  • Select a custom list of actions to include.
  • For coordinates, added support for binned coordinates (divide the screen with a grid, then click the middle of a grid cell).

Fixes #26.

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

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • 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

@ppasupat ppasupat marked this pull request as ready for review March 6, 2023 11:32
Copy link
Member

@pseudo-rnd-thoughts pseudo-rnd-thoughts left a comment

Choose a reason for hiding this comment

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

Changes look good, I just have a question on if the functions should be methods or just functions

raise ValueError(f"Unknown preset name {name}")


def get_action_space(config: ActionSpaceConfig) -> spaces.Space:
Copy link
Member

Choose a reason for hiding this comment

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

Do we want get_action_space and get_raw_coords as ActionSpaceConfig methods

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have moved the methods to ActionSpaceConfig.

@@ -2,6 +2,7 @@

include = [
"miniwob/**",
"tests/**",
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should be including tests in the release

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added that line to trigger pyright on presubmit. Is there a different way to trigger pyright on tests?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry I thought this line was for the files that are included in the release.
You are correct, this is the correct way of adding tests to pyright.
Though I should note that we normally don't care about having correct type hints for the tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks. It still helps with catching mistakes like missing method arguments, so I would prefer to keep it here for now.

@pseudo-rnd-thoughts pseudo-rnd-thoughts merged commit 475f36e into Farama-Foundation:master Mar 8, 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.

[Proposal] Alternative action spaces
2 participants