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

Commit bdbfd30

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 78eb766 commit bdbfd30

File tree

7 files changed

+12
-2
lines changed

7 files changed

+12
-2
lines changed

ocf_datapipes/convert/coordinates.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
from typing import Union
2+
3+
import xarray as xr
14
from torchdata.datapipes import functional_datapipe
25
from torchdata.datapipes.iter import IterDataPipe
3-
import xarray as xr
4-
from typing import Union
56

67
from ocf_datapipes.utils.geospatial import (
78
lat_lon_to_osgb,
@@ -13,6 +14,7 @@
1314
@functional_datapipe("convert_latlon_to_osgb")
1415
class ConvertLatLonToOSGBIterDataPipe(IterDataPipe):
1516
"""Convert from Lat/Lon object to OSGB"""
17+
1618
def __init__(self, source_datapipe: IterDataPipe):
1719
"""
1820
Convert from Lat/Lon to OSGB
@@ -34,6 +36,7 @@ def __iter__(self) -> Union[xr.DataArray, xr.Dataset]:
3436
@functional_datapipe("convert_osgb_to_latlon")
3537
class ConvertOSGBToLatLonIterDataPipe(IterDataPipe):
3638
"""Convert from OSGB to Lat/Lon"""
39+
3740
def __init__(self, source_datapipe: IterDataPipe):
3841
"""
3942
Convert from OSGB to Lat/Lon
@@ -55,6 +58,7 @@ def __iter__(self) -> Union[xr.DataArray, xr.Dataset]:
5558
@functional_datapipe("convert_geostationary_to_latlon")
5659
class ConvertGeostationaryToLatLonIterDataPipe(IterDataPipe):
5760
"""Convert from geostationary to Lat/Lon points"""
61+
5862
def __init__(self, source_datapipe: IterDataPipe):
5963
"""
6064
Convert from Geostationary to Lat/Lon points and add to Xarray object

ocf_datapipes/convert/gsp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
@functional_datapipe("convert_gsp_to_numpy_batch")
99
class ConvertGSPToNumpyBatchIterDataPipe(IterDataPipe):
1010
"""Convert GSP Xarray to NumpyBatch"""
11+
1112
def __init__(self, source_datapipe: IterDataPipe):
1213
"""
1314
Convert GSP Xarray to NumpyBatch object

ocf_datapipes/convert/nwp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
@functional_datapipe("convert_nwp_to_numpy_batch")
1010
class ConvertNWPToNumpyBatchIterDataPipe(IterDataPipe):
1111
"""Convert NWP Xarray objects to NumpyBatch ones"""
12+
1213
def __init__(self, source_datapipe: IterDataPipe):
1314
"""
1415
Convert NWP Xarray objecs to NumpyBatch ones

ocf_datapipes/convert/pv.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
@functional_datapipe("convert_pv_to_numpy_batch")
1010
class ConvertPVToNumpyBatchIterDataPipe(IterDataPipe):
1111
"""Convert PV Xarray to NumpyBatch"""
12+
1213
def __init__(self, source_datapipe: IterDataPipe):
1314
"""
1415
Convert PV Xarray objects to NumpyBatch objects

ocf_datapipes/convert/satellite.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
@functional_datapipe("convert_satellite_to_numpy_batch")
99
class ConvertSatelliteToNumpyBatchIterDataPipe(IterDataPipe):
1010
"""Converts Xarray Satellite to NumpyBatch object"""
11+
1112
def __init__(self, source_datapipe: IterDataPipe, is_hrv: bool = False):
1213
"""
1314
Converts Xarray satellite object to NumpyBatch object

ocf_datapipes/select/location_picker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
@functional_datapipe("location_picker")
99
class LocationPickerIterDataPipe(IterDataPipe):
1010
"""Picks locations from a dataset and returns them"""
11+
1112
def __init__(self, source_datapipe: IterDataPipe, return_all_locations: bool = False):
1213
"""
1314
Picks locations from a dataset and returns them

tests/convert/test_gsp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from ocf_datapipes.transform.xarray import AddT0IdxAndSamplePeriodDuration
55
from ocf_datapipes.utils.consts import BatchKey
66

7+
78
def test_convert_gsp_to_numpy_batch(gsp_dp):
89
gsp_dp = AddT0IdxAndSamplePeriodDuration(
910
gsp_dp, sample_period_duration=timedelta(minutes=5), history_duration=timedelta(minutes=60)

0 commit comments

Comments
 (0)