From 033f56a4f246bb9d261634e92b3cd82e3e35e17c Mon Sep 17 00:00:00 2001 From: Kristen Thyng Date: Tue, 29 Oct 2024 14:56:58 -0500 Subject: [PATCH] changed equal to allclose --- tests/test_datasets.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_datasets.py b/tests/test_datasets.py index cf4a7be..6063c0d 100644 --- a/tests/test_datasets.py +++ b/tests/test_datasets.py @@ -331,7 +331,9 @@ def test_trajectory(): # dsactual.to_netcdf(expname) dsexpected = xr.open_dataset(expname) dsexpected = dsexpected.assign_coords({"s_rho": dsexpected["s_rho"]})[key_variable] - assert dsexpected.equals(dsactual.astype(dsexpected.dtype)) + + # assert dsexpected.equals(dsactual.astype(dsexpected.dtype)) + assert np.allclose(dsexpected, dsactual, equal_nan=True) def test_trajectoryProfile(): @@ -396,7 +398,8 @@ def test_trajectoryProfile(): # # previously saved with: # dsactual.to_netcdf(expname) dsexpected = xr.open_dataarray(expname) - assert dsexpected.equals(dsactual.astype(dsexpected.dtype)) + # assert dsexpected.equals(dsactual.astype(dsexpected.dtype)) + assert np.allclose(dsexpected, dsactual, equal_nan=True) def test_grid():