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

Moved h5py, google_cloud_storage, pyarrow and tqdm to optional depend… #218

Merged
merged 15 commits into from
Aug 2, 2024

Conversation

JosephCarrino
Copy link
Contributor

Updated dependency list removing "portion" and "packaging", which are not used.
Some dependencies (i.e., h5py, google-cloud-storage) are now optional and not mandatory anymore, since they are used only for specific features. An ImportError expection is raised in case one is needed and not installed. Also, tqdm is now in docs/requirements.txt.

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.

Thank you for the PR @JosephCarrino!

It looks good, I just added a couple of comments. I will also have a deep look for Gymnasium dependency soon.

pyproject.toml Outdated Show resolved Hide resolved
minari/storage/remotes/gcp.py Outdated Show resolved Hide resolved
@younik
Copy link
Member

younik commented Jul 12, 2024

Oh also for Test Documentation, you should change this line to also install all:

run: pip install .[testing]

Then, you don't need anymore tqdm in docs/requirements.txt (can you also remove google-cloud-storage==2.5.0 from it? thanks)

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.

I left a couple of comments, then it should be good I believe 🤞

minari/data_collector/episode_buffer.py Outdated Show resolved Hide resolved
minari/storage/remotes/__init__.py Show resolved Hide resolved

from minari.data_collector.episode_buffer import EpisodeBuffer
from minari.dataset.minari_storage import MinariStorage


class ArrowStorage(MinariStorage):
FORMAT = "arrow"
Copy link
Member

Choose a reason for hiding this comment

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

Tests fails because there are places where FORMAT is used; let's keep FORMAT.

It would be nice to assert in init that the key is the same as MinariStorage.FORMAT. If you have time, change the init to be similar to the of CloudStorage: use a function get_minari_storage(key: str) (that uses the private registry of callables) and assert that storage.FORMAT == key. (Then you will also need to change the places where the registry is used to use the function instead). This is a very minor problem, so it's okay to skip it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I should have implemented this too, however this is a bite more tricky than the CloudStorage one, since this registry is used in many tests to get the list of the available storages. What I did is creating also a function get_storage_keys() -> List[str] that preserve the fact of registry being private and returns the list of its keys. I replaced the previous _storages.registry.keys() which was in some tests and functions by this new function.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good, can you push the changes? @JosephCarrino

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, thanks!

@younik younik merged commit b489361 into Farama-Foundation:main Aug 2, 2024
5 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.

2 participants