Skip to content

Commit

Permalink
added basic test for rectangular hgrid
Browse files Browse the repository at this point in the history
  • Loading branch information
ashjbarnes committed Sep 4, 2023
1 parent 16c877b commit 11c26d6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/test_grid_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import pytest
from regional_mom6 import angle_between
from regional_mom6 import quad_area
from regional_mom6 import rectangular_hgrid


# placeholder trivial test test
Expand All @@ -16,7 +17,7 @@ def test_angle_between(v1, v2, v3, true_angle):
assert np.isclose(angle_between(v1, v2, v3), true_angle)


X, Y = np.meshgrid(np.linspace(0, 90, 100), np.linspace(0, 90, 100))
## Parameters for quad_area test
X, Y = np.meshgrid(np.linspace(0, 90, 5), np.linspace(0, 90, 5))


Expand All @@ -30,4 +31,11 @@ def test_quad_area(lat, lon, true_area):
assert np.isclose(np.sum(quad_area(lat, lon)), true_area)


# what to return when pytest passes
@pytest.mark.parametrize(
("lat", "lon"),
[
(np.linspace(0, 10, 7), np.linspace(0, 10, 13)),
],
)
def test_rectangular_hgrid(lat, lon):
rectangular_hgrid(lat, lon)

0 comments on commit 11c26d6

Please sign in to comment.