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 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), (