From 53c2d1f86ca36522570d1243e050e782debe01cd Mon Sep 17 00:00:00 2001 From: devsjc <47188100+devsjc@users.noreply.github.com> Date: Thu, 30 May 2024 11:48:28 +0100 Subject: [PATCH] fix(ceda): Remove index creation --- src/nwp_consumer/internal/inputs/ceda/client.py | 2 +- src/nwp_consumer/internal/inputs/ceda/test_client.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nwp_consumer/internal/inputs/ceda/client.py b/src/nwp_consumer/internal/inputs/ceda/client.py index c479be61..d190953a 100644 --- a/src/nwp_consumer/internal/inputs/ceda/client.py +++ b/src/nwp_consumer/internal/inputs/ceda/client.py @@ -177,6 +177,7 @@ def mapCachedRaw(self, *, p: pathlib.Path) -> xr.Dataset: datasets: list[xr.Dataset] = cfgrib.open_datasets( path=p.as_posix(), chunks={"time": 1, "step": -1, "variable": -1, "x": "auto", "y": "auto"}, + backend_kwargs={"indexpath": ""}, ) except Exception as e: log.warn(event="error converting raw file to dataset", filepath=p.as_posix(), error=e) @@ -244,7 +245,6 @@ def mapCachedRaw(self, *, p: pathlib.Path) -> xr.Dataset: }, ) ) - print(wholesaleDataset) return wholesaleDataset def parameterConformMap(self) -> dict[str, internal.OCFParameter]: diff --git a/src/nwp_consumer/internal/inputs/ceda/test_client.py b/src/nwp_consumer/internal/inputs/ceda/test_client.py index 5b4a4b95..1eb5d587 100644 --- a/src/nwp_consumer/internal/inputs/ceda/test_client.py +++ b/src/nwp_consumer/internal/inputs/ceda/test_client.py @@ -40,7 +40,7 @@ def test_convertsWholesale1FileCorrectly(self) -> None: # Ensure the dimensions have the right sizes self.assertDictEqual( - {"init_time": 1, "step": 3, "y": 704, "x": 548}, + {"init_time": 1, "step": 4, "y": 704, "x": 548}, dict(out.sizes.items()), ) # Ensure the correct variables are in the variable dimension @@ -56,7 +56,7 @@ def test_convertsWholesale2FileCorrectly(self) -> None: # Ensure the dimensions have the right sizes self.assertDictEqual( - {"init_time": 1, "step": 3, "y": 704, "x": 548}, + {"init_time": 1, "step": 4, "y": 704, "x": 548}, dict(out.sizes.items()), ) # Ensure the correct variables are in the variable dimension