Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test hgrid generator #62

Merged
merged 7 commits into from
Sep 4, 2023
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 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


@pytest.mark.parametrize(
Expand All @@ -18,7 +19,6 @@ def test_angle_between(v1, v2, v3, true_angle):
# create a lat-lon mesh that covers 1/4 of the North Hemisphere
lon, lat = np.meshgrid(np.linspace(0, 90, 5), np.linspace(0, 90, 5))


@pytest.mark.parametrize(
("lat", "lon", "true_area"),
[
Expand All @@ -29,4 +29,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(
ashjbarnes marked this conversation as resolved.
Show resolved Hide resolved
("lat", "lon"),
[
(np.linspace(0, 10, 7), np.linspace(0, 10, 13)),
],
)
def test_rectangular_hgrid(lat, lon):
rectangular_hgrid(lat, lon)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we check that the output is an xarray dataset?

Loading