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

Fix _action_to_direction usage #4

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

SarvagyaVaish
Copy link
Contributor

@SarvagyaVaish SarvagyaVaish commented Jan 1, 2024

Description

To use the _action_to_direction dict, we need to first convert the numerical action (0, 1, 2, 3) to an Enum.

Fixes #3

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)

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.

Could we change the implementation on line 41 instead for it to be Actions.UP.value as I think this is still clear what is happening but means we don't need to do this conversion step.

@pseudo-rnd-thoughts
Copy link
Member

I just realised that I have already made this change over in Gymnasium but not here
https://gymnasium.farama.org/main/tutorials/gymnasium_basics/environment_creation/#sphx-glr-tutorials-gymnasium-basics-environment-creation-py

@SarvagyaVaish
Copy link
Contributor Author

Could we change the implementation on line 41 instead for it to be Actions.UP.value as I think this is still clear what is happening but means we don't need to do this conversion step.

Yeah! That's better :)

To use the _action_to_direction dict, we need to first convert the numerical action (0, 1, 2, 3) to an Enum.
@pseudo-rnd-thoughts pseudo-rnd-thoughts merged commit 92c7847 into Farama-Foundation:main Jan 3, 2024
1 of 2 checks passed
@SarvagyaVaish
Copy link
Contributor Author

@pseudo-rnd-thoughts Tests seem to be failing.

However, it's failing on the installation step. Not sure if it's the changes I introduced in this PR. Thoughts?

@pseudo-rnd-thoughts
Copy link
Member

@kir0ul is looking into it so I wouldn't worry about it for now. I don't believe that your PR caused the issue

@kir0ul kir0ul mentioned this pull request Jan 4, 2024
4 tasks
@kir0ul
Copy link
Contributor

kir0ul commented Jan 4, 2024

The issue was caused by some changes introduced by the Hatchling build backend (pypa/hatch#1089), hopefully PR #5 should fix it.

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.

Incorrect action reference
3 participants