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 all 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
12 changes: 11 additions & 1 deletion tests/test_grid_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import pytest
from regional_mom6 import angle_between
from regional_mom6 import quad_area
from regional_mom6 import rectangular_hgrid
import xarray as xr


@pytest.mark.parametrize(
Expand Down Expand Up @@ -29,4 +31,12 @@ 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
# a simple test that rectangular_hgrid runs without erroring
@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):
assert isinstance(rectangular_hgrid(lat, lon), xr.Dataset)