Skip to content

Commit 29d1553

Browse files
committed
lint
1 parent aa98e3b commit 29d1553

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

ocf_data_sampler/select/select_spatial_slice.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def select_spatial_slice_pixels(
6161
The selected DataArray slice.
6262
6363
Raises:
64-
ValueError: If the window dimensions are not even or the slice extends beyond the data
64+
ValueError: If the window dimensions are not even or the slice extends beyond the data
6565
boundaries.
6666
"""
6767
if (width_pixels % 2) != 0:
@@ -170,17 +170,17 @@ def select_spatial_slice_pixels_multiple(
170170
"Multi-location window not available: "
171171
f"left_idx ({left_idx}), right_idx ({right_idx}), "
172172
f"bottom_idx ({bottom_idx}), top_idx ({top_idx}), "
173-
f"data_width_pixels ({data_width_pixels}), data_height_pixels ({data_height_pixels})"
173+
f"data_width_pixels ({data_width_pixels}), data_height_pixels ({data_height_pixels})",
174174
)
175-
175+
176176
# Add buffer of 1 pixel if window is 2 pixels wide to ensure the central location is within the
177177
# returned slice
178178
x_buffer = 1 if width_pixels==2 else 0
179179
y_buffer = 1 if height_pixels==2 else 0
180180

181181
return da.isel(
182182
{
183-
x_dim: slice(left_idx, right_idx+x_buffer),
184-
y_dim: slice(bottom_idx, top_idx+y_buffer)
185-
}
183+
x_dim: slice(left_idx, right_idx+x_buffer),
184+
y_dim: slice(bottom_idx, top_idx+y_buffer),
185+
},
186186
)

ocf_data_sampler/torch_datasets/utils/spatial_slice_for_dataset.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
"""Functions for selecting data around a given location."""
22

3-
import xarray as xr
43

54
from ocf_data_sampler.config import Configuration
6-
from ocf_data_sampler.select.geospatial import find_coord_system
75
from ocf_data_sampler.select.location import Location
86
from ocf_data_sampler.select.select_spatial_slice import (
9-
select_spatial_slice_pixels, select_spatial_slice_pixels_multiple
7+
select_spatial_slice_pixels,
8+
select_spatial_slice_pixels_multiple,
109
)
1110

1211

0 commit comments

Comments
 (0)