Skip to content

Commit 1edcec7

Browse files
authored
add 2x2 test (#28)
* add 2x2 test * remove placeholder
1 parent 34ca3ca commit 1edcec7

2 files changed

Lines changed: 15 additions & 19 deletions

File tree

pydomcfg/tests/test_placeholder.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

pydomcfg/tests/test_zco.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
import xarray as xr
77

88
from pydomcfg.domzgr.zco import Zco
9-
from pydomcfg.tests.bathymetry import Bathymetry
9+
10+
from .bathymetry import Bathymetry
1011

1112

1213
def test_zco_orca2():
@@ -123,3 +124,16 @@ def test_zco_uniform():
123124
# truncation errors
124125
eps = 1.0e-14
125126
xr.testing.assert_allclose(dsz_fd, dsz_an, rtol=eps, atol=0)
127+
128+
129+
def test_zco_x_y_invariant():
130+
"""Make sure all vertical columns are identical"""
131+
132+
# Generate 2x2 flat bathymetry dataset
133+
ds_bathy = Bathymetry(1000.0, 1200.0, 2, 2).flat(5000.0)
134+
zco = Zco(ds_bathy, 10)
135+
ds = zco(10.0, 5.0e3)
136+
137+
# Check z3 and e3
138+
for var in ["z3T", "z3W", "e3T", "e3W"]:
139+
assert (ds[var] == ds[var].mean(["x", "y"])).all()

0 commit comments

Comments
 (0)