Commit de4acc94 authored by Jan Klaus Rieck's avatar Jan Klaus Rieck

test timeave()

parent de54a89d
Pipeline #3602 failed with stage
in 1 minute and 50 seconds
......@@ -367,7 +367,8 @@ def is_leap_year(year):
bool
"""
return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
leap = year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
return leap
def timeave(ds, monthly=False, std_count=False):
......
......@@ -255,6 +255,24 @@ def test_construct_ef(ds_sel):
'e3f has a depth dimension'
def test_timeave():
""" Test timeave().
"""
t_ave = xbox.timeave(ds)
assert 't' not in t_ave,\
'time averaging did not work'
def test_timeave_raises_keyerror():
""" Test whether timeave() raises key errorself.
"""
ds_t_ave = ds.mean('t')
with pytest.raises(KeyError):
xbox.timeave(ds_t_ave)
@pytest.mark.parametrize('time',
[['2000-01-01', '2000-01-31'],
['2000-01-01', '2000-06-30']])
......
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