Skip to content

Commit

Permalink
Moved h5py, google_cloud_storage, pyarrow and tqdm to optional depend…
Browse files Browse the repository at this point in the history
…encies. Removed portion and packaging.
  • Loading branch information
JosephCarrino committed Jul 12, 2024
1 parent 338b19a commit 1a8fa88
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/root/.mujoco/mujoco210/bin"
COPY . /usr/local/minari/
WORKDIR /usr/local/minari/

RUN pip install .[testing] --no-cache-dir
RUN pip install .[all,testing] --no-cache-dir

ENTRYPOINT ["/usr/local/minari/bin/docker_entrypoint"]
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ git+https://github.com/Farama-Foundation/Celshast#egg=furo
torchrl-nightly>=2023.12.30
pyvirtualdisplay
moviepy
tqdm
11 changes: 9 additions & 2 deletions minari/dataset/_storages/arrow_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@

import gymnasium as gym
import numpy as np
import pyarrow as pa
import pyarrow.dataset as ds


try:
import pyarrow as pa
import pyarrow.dataset as ds
except ImportError:
raise ImportError(
'pyarrow is not installed. Please install it using `pip install "minari[pyarrow]"`'
)

from minari.data_collector.episode_buffer import EpisodeBuffer
from minari.dataset.minari_storage import MinariStorage
Expand Down
9 changes: 8 additions & 1 deletion minari/dataset/_storages/hdf5_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@
from typing import Dict, Iterable, List, Optional, Tuple, Union

import gymnasium as gym
import h5py
import numpy as np

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


try:
import h5py
except ImportError:
raise ImportError(
'h5py is not installed. Please install it using `pip install "minari[h5py]"`'
)


_MAIN_FILE_NAME = "main_data.hdf5"


Expand Down
12 changes: 9 additions & 3 deletions minari/storage/remotes/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
from pathlib import Path
from typing import Any, Optional

from google.cloud import storage
from tqdm.auto import tqdm

from minari.storage.remotes.cloud_storage import CloudStorage


try:
from google.cloud import storage
from tqdm import tqdm
except ImportError:
raise ImportError(
'google-cloud-storage or tqdm are not installed. Please install it using `pip install "minari[gcs]"`'
)


class GCPStorage(CloudStorage):
def __init__(self, name: str, key_path: Optional[str] = None) -> None:
if key_path is None:
Expand Down
15 changes: 8 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,27 @@ classifiers = [
dependencies = [
"numpy>=1.21.0",
"jax[cpu]",
"pyarrow",
"h5py>=3.8.0",
"tqdm>=4.65.0",
"typing_extensions>=4.4.0",
"google-cloud-storage>=2.5.0",
"typer[all]>=0.9.0",
"gymnasium>=0.28.1",
"portion>=2.4.0",
"packaging>=23.1",
]

dynamic = ["version"]

[project.optional-dependencies]
pyarrow = ["pyarrow"]
h5py = ["h5py>=3.8.0"]
gcs = ["google-cloud-storage>=2.5.0", "tqdm>=4.65.0"]

all = ["minari[pyarrow,h5py,gcs]"]

testing = [
"pytest>=7.1.3",
"gymnasium-robotics>=1.2.3",
"mktestdocs",
"torchrl",
"agilerl"
"agilerl",
"h5py>=3.8.0",
]

[project.urls]
Expand Down

0 comments on commit 1a8fa88

Please sign in to comment.