From c9498eadccae83e9d0442e480847504c5e3ed6af Mon Sep 17 00:00:00 2001 From: "stephen.worsley" Date: Thu, 2 May 2024 11:12:54 +0100 Subject: [PATCH] fix test --- esmf_regrid/tests/unit/schemes/test__cube_to_GridInfo.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/esmf_regrid/tests/unit/schemes/test__cube_to_GridInfo.py b/esmf_regrid/tests/unit/schemes/test__cube_to_GridInfo.py index 8053e71c..386a562c 100644 --- a/esmf_regrid/tests/unit/schemes/test__cube_to_GridInfo.py +++ b/esmf_regrid/tests/unit/schemes/test__cube_to_GridInfo.py @@ -8,6 +8,7 @@ import pytest import scipy.sparse +from esmf_regrid import Constants from esmf_regrid.esmf_regridder import Regridder from esmf_regrid.schemes import _contiguous_masked, _cube_to_GridInfo @@ -233,7 +234,7 @@ def test_center(curvilinear): # The following test ensures there are no overlapping cells. # This catches geometric/topological abnormalities that would arise from, # for example: switching lat/lon values, using euclidean coords vs spherical. - rg = Regridder(gridinfo, gridinfo, method="bilinear") + rg = Regridder(gridinfo, gridinfo, method=Constants.Method.BILINEAR) expected_weights = scipy.sparse.identity(n_lats * n_lons) assert np.array_equal(expected_weights.todense(), rg.weight_matrix.todense()) assert gridinfo.crs == GeogCS(EARTH_RADIUS).as_cartopy_crs() @@ -244,7 +245,9 @@ def test_center(curvilinear): # to be geometrically equivalent to the non-circular case. circular_gridinfo = _cube_to_GridInfo(cube, center=True) circular_gridinfo.circular = True - rg_circular = Regridder(circular_gridinfo, gridinfo, method="bilinear") + rg_circular = Regridder( + circular_gridinfo, gridinfo, method=Constants.Method.BILINEAR + ) assert np.allclose(expected_weights.todense(), rg_circular.weight_matrix.todense())