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

get_dataset and cli download ability #322

Conversation

grahamannett
Copy link
Contributor

Am waiting for the group at minari to release a minor version update so I can pin the version which will allow minari.load_dataset(env_name, download=True) to work but here is an integration for minari which is the same idea as d4rl but seems like that group want people to switch over to using minari as it is a more standardized format for offline-rl.

Here is a naive implementation of getting the dataset but requires loading it all into memory which I think can be avoided (so episodes are only read from disk once asked for) once I understand a little deeper the ReplayBuffer class. Other than that is there anything else needed for a PR? Maybe can include a test as well.

Also whats up with the formatting, it seems like you use line length of 80 on the format script but the pylintrc uses 100? I may need to reformat as I was using default black line length which is 88 i believe.

Copy link
Owner

@takuseno takuseno left a comment

Choose a reason for hiding this comment

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

@grahamannett Thank you for your PR! Largely looks good to me.

Regarding the formatting, can you try this?

# formatting
pip install black isort docformatter
./scripts/format

# linter
pip install mypy pylint==2.13.5
./scripts/lint

Other than that, I'd like you to give me an example I can try an experiment with Minari?

Once again, thank you for your contribution!

d3rlpy/cli.py Outdated
subprocess.run(["pip3", "uninstall", "-y", "pybullet"], check=True)
else:
raise ValueError(f"Unsupported command: {name}")
match name:
Copy link
Owner

Choose a reason for hiding this comment

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

Can you revert this change to use if-else conditions? Because match is supported since Python3.10, however d3rlpy supports Python3.8 or above. It's a little too early to use this Python feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah figured you wouldnt want this as its gonna break all <3.10 but thought it was worth a try. its a shame it will never really be a used feature as i tend to find it pretty apt for exactly this situation

@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #322 (70f69eb) into master (c5d50aa) will increase coverage by 0.27%.
The diff coverage is 12.50%.

❗ Current head 70f69eb differs from pull request most recent head 4b27c86. Consider uploading reports for the commit 4b27c86 to get more accurate results

@@            Coverage Diff             @@
##           master     #322      +/-   ##
==========================================
+ Coverage   92.59%   92.86%   +0.27%     
==========================================
  Files         110      108       -2     
  Lines        7385     7150     -235     
==========================================
- Hits         6838     6640     -198     
+ Misses        547      510      -37     
Files Coverage Δ
d3rlpy/datasets.py 45.13% <12.50%> (+5.13%) ⬆️

... and 54 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@grahamannett
Copy link
Contributor Author

@takuseno yeah the format stuff I just had to copy the flags from the format script into my workspace settings. still waiting on the guy i was talking to at minari/farama to version bump and then will update with version/example/test/whatever

@grahamannett grahamannett force-pushed the graham/feature-minari-dataset-integration branch from 88bc8c6 to f108a43 Compare October 9, 2023 22:08
@grahamannett
Copy link
Contributor Author

i had to redo my branch and think this is everything updated. removed the case/match and included a test. I thought before that there was a place that you pinned d4rl/gym/etc but now i dont see it so its just in the install part. minari version 0.4.2 was just released so that it will download the dataset if its not already. let me know if you want me to fix/change anything else (or if i forgot something as i had a messed up PR) @takuseno

@grahamannett
Copy link
Contributor Author

@takuseno do you need me to do anything more?

@takuseno
Copy link
Owner

takuseno commented Nov 3, 2023

@grahamannett Thanks for the update! There seem linter errors, but I'll follow up on this. Thank you for your contribution!

@takuseno takuseno merged commit 8e139fc into takuseno:master Nov 3, 2023
0 of 3 checks passed
@grahamannett grahamannett deleted the graham/feature-minari-dataset-integration branch November 4, 2023 22:22
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