Commit 4ab3f525 authored by Jan Klaus Rieck's avatar Jan Klaus Rieck

rewrite test_timeave() and test_depthave() to test with output from getbox()

parent 919b7293
Pipeline #3615 failed with stage
in 1 minute and 54 seconds
......@@ -83,10 +83,10 @@ ds = xr.Dataset({'dummy_0cc': (['t', 'y_c', 'x_c'], dummy_3Dt),
'umask': (['z_c', 'y_c', 'x_r'], tmask),
'vmask': (['z_c', 'y_r', 'x_c'], tmask),
'fmask': (['z_c', 'y_r', 'x_r'], tmask),
'box_tmask': (['z_c', 'y_c', 'x_c'], tmask),
'box_umask': (['z_c', 'y_c', 'x_r'], tmask),
'box_vmask': (['z_c', 'y_r', 'x_c'], tmask),
'box_fmask': (['z_c', 'y_r', 'x_r'], tmask)})
'tmask': (['z_c', 'y_c', 'x_c'], tmask),
'umask': (['z_c', 'y_c', 'x_r'], tmask),
'vmask': (['z_c', 'y_r', 'x_c'], tmask),
'fmask': (['z_c', 'y_r', 'x_r'], tmask)})
ds_z_c = xr.Dataset({'dummy_0cc': (['t', 'y_c', 'x_c'], dummy_3Dt),
'dummy_ccc': (['t', 'z_c', 'y_c', 'x_c'], dummy_4D),
......@@ -122,11 +122,7 @@ ds_z_c = xr.Dataset({'dummy_0cc': (['t', 'y_c', 'x_c'], dummy_3Dt),
'tmask': (['z_c', 'y_c', 'x_c'], tmask),
'umask': (['z_c', 'y_c', 'x_r'], tmask),
'vmask': (['z_c', 'y_r', 'x_c'], tmask),
'fmask': (['z_c', 'y_r', 'x_r'], tmask),
'box_tmask': (['z_c', 'y_c', 'x_c'], tmask),
'box_umask': (['z_c', 'y_c', 'x_r'], tmask),
'box_vmask': (['z_c', 'y_r', 'x_c'], tmask),
'box_fmask': (['z_c', 'y_r', 'x_r'], tmask)})
'fmask': (['z_c', 'y_r', 'x_r'], tmask)})
ds_z_l = xr.Dataset({'dummy_0cc': (['t', 'y_c', 'x_c'], dummy_3Dt),
'dummy_lcc': (['t', 'z_l', 'y_c', 'x_c'], dummy_4D)},
......@@ -312,7 +308,9 @@ def test_timeave(monthly):
""" Test timeave().
"""
t_ave = xbox.timeave(ds_z_l, monthly=monthly)[0]
ds_box = xbox.getbox(ds_z_l, time=['2000-01-01', '2000-06-30'],
depth=[500, 1000], x=[10, 20], y=[0, 40])
t_ave = xbox.timeave(ds_box, monthly=monthly)[0]
assert 't' and 'month' not in t_ave.dims,\
'time averaging did not work'
......@@ -332,7 +330,9 @@ def test_depthave(ds):
""" Test depthave().
"""
ds_d_ave = xbox.depthave(ds)[0]
ds_box = xbox.getbox(ds_z_l, time=['2000-01-01', '2000-06-30'],
depth=[500, 1000], x=[10, 20], y=[0, 40])
ds_d_ave = xbox.depthave(ds_box)[0]
assert 'z_c' and 'z_l' not in ds_d_ave.dims,\
'depth averaging failed'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment