Skip to content

Conversation

younik
Copy link
Member

@younik younik commented Jun 8, 2023

Description

Make EpisodeData a dataclass instead of NamedTuple and implement __repr__ method as suggested in #79

Type of change

  • New feature (non-breaking change which adds functionality)

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

@younik younik requested a review from balisujohn June 8, 2023 16:03
Copy link
Collaborator

@balisujohn balisujohn left a comment

Choose a reason for hiding this comment

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

I think it would be good to add a test for this, but otherwise it looks good to me.

@balisujohn balisujohn mentioned this pull request Jun 9, 2023
@younik
Copy link
Member Author

younik commented Jun 11, 2023

I think it would be good to add a test for this, but otherwise it looks good to me.

I added a test for it, thanks!

For testing, I copied the list of spaces that you used in your PR and added them to a file test_common; if we merge this first, you should update your test_serialization to use it

@younik younik requested a review from balisujohn June 11, 2023 19:28
@balisujohn
Copy link
Collaborator

Thanks for the test. I like the shared dependency for the test spaces so we avoid repeating definitions, I'll copy this pattern for the Dummy space registration for the unflattened spaces PR.

For the new test, can you also add an assert to the test that checks to see that the repr matches the expected repr string for each space?

@younik
Copy link
Member Author

younik commented Jun 12, 2023

Thanks for the test. I like the shared dependency for the test spaces so we avoid repeating definitions, I'll copy this pattern for the Dummy space registration for the unflattened spaces PR.

For the new test, can you also add an assert to the test that checks to see that the repr matches the expected repr string for each space?

done

Copy link
Collaborator

@balisujohn balisujohn left a comment

Choose a reason for hiding this comment

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

LGTM :^)

@balisujohn balisujohn merged commit 7ca16b3 into Farama-Foundation:main Jun 12, 2023
younik added a commit to younik/Minari that referenced this pull request Mar 21, 2025
* episodedata as dataclass

* add test

* fix pre-commit

* add __init__ to test

* enhance test
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