Skip to content

Commit 5f3b12c

Browse files
committed
amend
1 parent 83a6667 commit 5f3b12c

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

.github/unittest/linux_libs/scripts_roboset/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ dependencies:
1919
- hydra-core
2020
- huggingface_hub
2121
- tqdm
22+
- h5py

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ def _main(argv):
218218
"tqdm",
219219
"scikit-learn",
220220
"pandas",
221+
"h5py",
221222
],
222223
"marl": ["vmas>=1.2.10", "pettingzoo>=1.24.1"],
223224
}

torchrl/data/datasets/roboset.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
from torchrl.data.replay_buffers.writers import Writer
2525

2626
_has_tqdm = importlib.util.find_spec("tqdm", None) is not None
27+
_has_h5py = importlib.util.find_spec("h5py", None) is not None
28+
_has_hf_hub = importlib.util.find_spec("huggingface_hub", None) is not None
2729

2830
_NAME_MATCH = KeyDependentDefaultDict(lambda key: key)
2931
_NAME_MATCH["observations"] = "observation"
@@ -158,6 +160,10 @@ def __init__(
158160
split_trajs: bool = False,
159161
**env_kwargs,
160162
):
163+
if not _has_h5py or not _has_hf_hub:
164+
raise ImportError(
165+
"h5py and huggingface_hub are required for Roboset datasets."
166+
)
161167
if dataset_id not in self.available_datasets:
162168
raise ValueError(
163169
f"The dataset_id {dataset_id} isn't part of the accepted datasets. "

0 commit comments

Comments
 (0)