From cdbb75cfb4a395cf6729955760e5d7ba3e288f62 Mon Sep 17 00:00:00 2001 From: tomvothecoder Date: Wed, 20 Mar 2024 17:20:14 -0500 Subject: [PATCH] Fix `test_global_mean_grid` and `test_zonal_grid` --- tests/test_regrid.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/test_regrid.py b/tests/test_regrid.py index 4b2c6c08..193a22a6 100644 --- a/tests/test_regrid.py +++ b/tests/test_regrid.py @@ -919,10 +919,14 @@ def test_gaussian_grid(self): assert uneven_grid.lon.shape == (67,) def test_global_mean_grid(self): - source_grid = grid.create_grid( - x=np.array([0, 45, 90, 180, 270, 360]), - y=np.array([-80, -40, 0, 40, 80]), + x = grid.create_axis( + "lon", np.array([0, 45, 90, 180, 270, 360]), generate_bounds=True ) + y = grid.create_axis( + "lat", np.array([-80, -40, 0, 40, 80]), generate_bounds=True + ) + + source_grid = grid.create_grid(x=x, y=y) mean_grid = grid.create_global_mean_grid(source_grid) @@ -1001,10 +1005,14 @@ def test_raises_error_for_global_mean_grid_if_an_axis_has_multiple_dimensions(se grid.create_global_mean_grid(source_grid_with_2_lons) def test_zonal_grid(self): - source_grid = grid.create_grid( - x=np.array([-160, -80, 80, 160]), - y=np.array([-80, -40, 0, 40, 80]), + x = grid.create_axis( + "lon", np.array([-160, -80, 80, 160]), generate_bounds=True ) + y = grid.create_axis( + "lat", np.array([-80, -40, 0, 40, 80]), generate_bounds=True + ) + + source_grid = grid.create_grid(x=x, y=y) zonal_grid = grid.create_zonal_grid(source_grid)