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 obs/act spaces when combining datasets #163

Merged
merged 3 commits into from Nov 11, 2023

Conversation

rodrigodelazcano
Copy link
Member

@rodrigodelazcano rodrigodelazcano commented Nov 11, 2023

Description

Datasets should have the same observation and action space before being combined. The spaces should also be stored as an attribute in case the dataset has different spaces from the env used to create the dataset (then spaces shouldn't be inferred when loading the dataset)

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

@younik younik left a comment

Choose a reason for hiding this comment

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

LGTM

minari/utils.py Outdated
Comment on lines 191 to 192
assert all(dataset.action_space == datasets_to_combine[0].action_space for dataset in datasets_to_combine), "The datasets to combine must have the same action space"
assert all(dataset.observation_space == datasets_to_combine[0].observation_space for dataset in datasets_to_combine), "The datasets to combine must have the same observation space"
Copy link
Member

Choose a reason for hiding this comment

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

maybe change these lines to

if any(dataset.action_space != datasets_to_combine[0].action_space for dataset in datasets_to_combine):
   raise ValueError("...")

?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@younik younik merged commit f55c1e3 into Farama-Foundation:main Nov 11, 2023
6 checks passed
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.

None yet

2 participants