Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit ed22fa2

Browse files
committed
Update LocationPicker docstring
1 parent ae7705e commit ed22fa2

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

ocf_datapipes/select/location_picker.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,22 @@
77

88
@functional_datapipe("location_picker")
99
class LocationPickerIterDataPipe(IterDataPipe):
10-
def __init__(self, source_dp: IterDataPipe, return_all_locations: bool = False):
10+
"""Picks locations from a dataset and returns them"""
11+
def __init__(self, source_datapipe: IterDataPipe, return_all_locations: bool = False):
12+
"""
13+
Picks locations from a dataset and returns them
14+
15+
Args:
16+
source_datapipe: Datapipe emitting Xarray Dataset
17+
return_all_locations: Whether to return all locations, if True, also returns them in order
18+
"""
1119
super().__init__()
12-
self.source_dp = source_dp
20+
self.source_datapipe = source_datapipe
1321
self.return_all_locations = return_all_locations
1422

1523
def __iter__(self) -> Location:
16-
for xr_dataset in self.source_dp:
24+
"""Returns locations from the inputs datapipe"""
25+
for xr_dataset in self.source_datapipe:
1726
if self.return_all_locations:
1827
# Iterate through all locations in dataset
1928
for location_idx in range(len(xr_dataset["x_osgb"])):

0 commit comments

Comments
 (0)