Skip to content

Commit

Permalink
Fix test_global_mean_grid and test_zonal_grid
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvothecoder committed Mar 20, 2024
1 parent cac4a90 commit cdbb75c
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions tests/test_regrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit cdbb75c

Please sign in to comment.