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

Commit aed3d60

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

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ocf_datapipes/select/select_time_slice_nwp.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,10 @@ def __init__(
6262
assert 0 <= dropout_frac <= 1
6363
self._consider_dropout = (dropout_timedeltas is not None) and dropout_frac > 0
6464

65-
6665
def __iter__(self) -> Union[xr.DataArray, xr.Dataset]:
6766
"""Iterate through both datapipes and convert Xarray dataset"""
6867

6968
for t0, xr_data in self.t0_datapipe.zip(self.source_datapipe):
70-
7169
# The accumatation and non-accumulation channels
7270
accum_channels = np.intersect1d(
7371
xr_data[self.channel_dim_name].values, self.accum_channels
@@ -132,7 +130,9 @@ def __iter__(self) -> Union[xr.DataArray, xr.Dataset]:
132130

133131
# Slice out the data which does not need to be diffed
134132
xr_non_accum = xr_min.sel({self.channel_dim_name: non_accum_channels})
135-
xr_sel_non_accum = xr_non_accum.sel(step=step_indexer, init_time_utc=init_time_indexer)
133+
xr_sel_non_accum = xr_non_accum.sel(
134+
step=step_indexer, init_time_utc=init_time_indexer
135+
)
136136

137137
# Slice out the channels which need to be diffed
138138
xr_accum = xr_min.sel({self.channel_dim_name: accum_channels})
@@ -152,6 +152,5 @@ def __iter__(self) -> Union[xr.DataArray, xr.Dataset]:
152152
f"diff_{v}" if v in accum_channels else v
153153
for v in xr_sel[self.channel_dim_name].values
154154
]
155-
156155

157156
yield xr_sel

0 commit comments

Comments
 (0)