diff --git a/pyproject.toml b/pyproject.toml index a90902fb..8d98a8b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,6 @@ # --- PROJECT CONFIGURATION --- # + [build-system] requires = ["setuptools>=67", "wheel", "setuptools-git-versioning>=1.13.3"] build-backend = "setuptools.build_meta" diff --git a/src/nwp_consumer/internal/inputs/metoffice/client.py b/src/nwp_consumer/internal/inputs/metoffice/client.py index e6add119..b003ecef 100644 --- a/src/nwp_consumer/internal/inputs/metoffice/client.py +++ b/src/nwp_consumer/internal/inputs/metoffice/client.py @@ -229,6 +229,17 @@ def mapCachedRaw(self, *, p: pathlib.Path) -> xr.Dataset: # noqa: D102 {currentName: internal.OCFParameter.WindSpeedSurfaceAdjustedAGL.value}, ) + # There is some weird behaviour with the radiation parameters, and different setups + # this is a catch all situation (hopefully) + case "sdswrf", 7: + parameterDataset = parameterDataset.rename( + {currentName: 'dswrf'}, + ) + case "sdlwrf", 3: + parameterDataset = parameterDataset.rename( + {currentName: 'dlwrf'}, + ) + # Map the data to the internal dataset representation # * Transpose the Dataset so that the dimensions are correctly ordered # * Rechunk the data to a more optimal size diff --git a/src/nwp_consumer/internal/inputs/metoffice/test_client.py b/src/nwp_consumer/internal/inputs/metoffice/test_client.py index 20a95798..1af02b34 100644 --- a/src/nwp_consumer/internal/inputs/metoffice/test_client.py +++ b/src/nwp_consumer/internal/inputs/metoffice/test_client.py @@ -28,7 +28,6 @@ def test_errorsWhenVariablesAreNotSet(self) -> None: class TestClient(unittest.TestCase): """Tests for the MetOfficeClient.""" - @unittest.skip("Broken on github ci") def test_mapCachedRaw(self) -> None: tests = [ @@ -55,9 +54,11 @@ def test_mapCachedRaw(self) -> None: # Ensure the dimensions of the variables are correct for data_var in out.data_vars: - self.assertEqual(list(out[data_var].dims), tst["expected_dims"]) + self.assertEqual(list(out[data_var].dims), tst["expected_dims"], + msg=f'Dims "{list(out[data_var].dims)}" not as expected in {tst}') # Ensure the correct variable is in the data_vars - self.assertTrue(tst["expected_var"] in list(out.data_vars.keys())) + self.assertTrue(tst["expected_var"] in list(out.data_vars.keys()), + msg=f'Variable "{list(out.data_vars.keys())}" not as expected in {tst}') # Ensure no unknowns self.assertNotIn("unknown", list(out.data_vars.keys()))