Skip to content

Commit

Permalink
add test for layer thickness profile generation
Browse files Browse the repository at this point in the history
  • Loading branch information
navidcy committed Feb 18, 2024
1 parent 5a0c67e commit 4247900
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_grid_generation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np
import pytest
from regional_mom6 import dz_hyperbolictan
from regional_mom6 import angle_between
from regional_mom6 import latlon_to_cartesian
from regional_mom6 import quadrilateral_area
Expand All @@ -8,6 +9,23 @@
import xarray as xr


@pytest.mark.parametrize(
("nlayers", "ratio", "target_depth"),
[
(20, 1/3, 1000),
(20, 2, 1000),
(20, 10, 1000),
(20, 2, 3000),
(50, 1/3, 1000),
(50, 2, 1000),
(50, 10, 1000),
(50, 2, 3000),
],
)
def test_dz_hyperbolictan(nlayers, ratio, target_depth):
assert np.isclose(dz_hyperbolictan(nlayers, ratio, target_depth),
np.flip(dz_hyperbolictan(nlayers, 1 / ratio, target_depth))).all()

@pytest.mark.parametrize(
("lat", "lon", "true_xyz"),
[
Expand Down

0 comments on commit 4247900

Please sign in to comment.