Example #1
0
 def test_missing_days_in_quarter(self, tas_series):
     a = np.arange(360.0)
     a[5:
       16] = np.nan  # Number of missing values under acceptable limit in a month
     ts = tas_series(a)
     out = missing.missing_wmo(ts, freq="QS-JAN")
     np.testing.assert_array_equal(out, [True, False, False, True])
Example #2
0
 def test_missing_days(self, tas_series):
     a = np.arange(360.0)
     a[5:7] = np.nan  # Number of missing values under acceptable limit in a month
     a[40:45] = np.nan  # Too many consecutive missing values
     a[70:92:2] = np.nan  # Too many non-consecutive missing values
     ts = tas_series(a)
     out = missing.missing_wmo(ts, freq="MS")
     assert not out[0]
     assert out[1]
     assert out[2]
Example #3
0
    def test_hourly(self, pr_hr_series):
        pr = pr_hr_series(np.zeros(30))

        with pytest.raises(ValueError):
            missing.missing_wmo(pr, freq="MS")
Example #4
0
 def test_incomplete_year(self, tas_series):
     # One complete month
     a = np.arange(31)
     ts = tas_series(a)
     out = missing.missing_wmo(ts, freq="YS")
     np.testing.assert_array_equal(out, [True])