From 746eef36f9d3411d15255121d8825f443bb7a845 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Wed, 23 Aug 2023 08:02:26 +0100 Subject: [PATCH] make sure slice on osgb is ints --- .bumpversion.cfg | 1 + nowcasting_dataset/data_sources/data_source.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 2d05baf4..863b0dc9 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -2,6 +2,7 @@ commit = True tag = True current_version = 3.7.29 +message = Bump version: {current_version} → {new_version} [skip ci] [bumpversion:file:setup.py] search = version="{current_version}" diff --git a/nowcasting_dataset/data_sources/data_source.py b/nowcasting_dataset/data_sources/data_source.py index d4760e70..2ccf18ed 100644 --- a/nowcasting_dataset/data_sources/data_source.py +++ b/nowcasting_dataset/data_sources/data_source.py @@ -445,8 +445,8 @@ def get_example(self, location: SpaceTimeLocation) -> xr.Dataset: x_center_osgb=x_center_osgb, y_center_osgb=y_center_osgb ) selected_data = selected_data.sel( - x_osgb=slice(bounding_box.left, bounding_box.right), - y_osgb=slice(bounding_box.top, bounding_box.bottom), + x_osgb=slice(int(bounding_box.left), int(bounding_box.right)), + y_osgb=slice(int(bounding_box.top), int(bounding_box.bottom)), ) # selected_sat_data is likely to have 1 too many pixels in x and y