Skip to content

Commit 30a4c01

Browse files
authored
Update era5_dataset.py (#691)
1 parent 6a7e1a4 commit 30a4c01

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ppsci/data/dataset/era5_dataset.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,19 @@ class ERA5SampledDataset(io.Dataset):
163163
weight_dict (Optional[Dict[str, float]]): Weight dictionary. Defaults to None.
164164
transforms (Optional[vision.Compose]): Compose object contains sample wise
165165
transform(s). Defaults to None.
166+
166167
Examples:
167168
>>> import ppsci
168169
>>> dataset = ppsci.data.dataset.ERA5SampledDataset(
169170
... "file_path": "/path/to/ERA5SampledDataset",
170171
... "input_keys": ("input",),
171172
... "label_keys": ("output",),
172173
... ) # doctest: +SKIP
174+
>>> # get the length of the dataset
175+
>>> dataset_size = len(dataset)
176+
>>> # get the first sample of the data
177+
>>> first_sample = dataset[0]
178+
>>> print("First sample:", first_sample)
173179
"""
174180

175181
def __init__(

0 commit comments

Comments
 (0)