From cfdc10ec4970ccd5d71d31d49644d339162899b9 Mon Sep 17 00:00:00 2001 From: davidwilby <24752124+davidwilby@users.noreply.github.com> Date: Fri, 13 Dec 2024 16:36:52 +0000 Subject: [PATCH 1/2] fix to be compatible with numpy > 1.16 --- tests/test_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_model.py b/tests/test_model.py index 3e1d1343..3a221207 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -156,7 +156,7 @@ def test_prediction_shapes_lowlevel(self, n_target_sets): ): task = tl("2020-01-01", context_sampling, target_sampling) - n_targets = np.product(expected_obs_shape) + n_targets = np.prod(expected_obs_shape) # Tensors mean = model.mean(task) @@ -192,7 +192,7 @@ def test_prediction_shapes_lowlevel(self, n_target_sets): ) if likelihood in ["cnp", "gnp"]: - n_target_dims = np.product(tl.target_dims) + n_target_dims = np.prod(tl.target_dims) assert_shape( model.covariance(task), ( From f169427d5f73badeee4bb5324cf96b421c1a8c09 Mon Sep 17 00:00:00 2001 From: davidwilby <24752124+davidwilby@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:22:39 +0000 Subject: [PATCH 2/2] ensure correct type for model saving --- deepsensor/data/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepsensor/data/utils.py b/deepsensor/data/utils.py index c762a077..3970ed14 100644 --- a/deepsensor/data/utils.py +++ b/deepsensor/data/utils.py @@ -91,7 +91,7 @@ def compute_xarray_data_resolution(ds: Union[xr.DataArray, xr.Dataset]) -> float """ x1_res = np.abs(np.mean(np.diff(ds["x1"]))) x2_res = np.abs(np.mean(np.diff(ds["x2"]))) - data_resolution = np.min([x1_res, x2_res]) + data_resolution = float(np.min([x1_res, x2_res])) return data_resolution