def test_missing_period(self, tas_series):
     tas = tas_series(np.ones(366), start="2000-01-01")
     tas = tas.sel(time=tas.time.dt.month.isin([1, 2, 3, 4, 12]))
     out = missing.missing_pct(tas,
                               freq="MS",
                               tolerance=0.9,
                               src_timestep="D")
     np.testing.assert_array_equal(out, [False] * 4 + [True] * 7 + [False])
Exemple #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 missing values
     ts = tas_series(a)
     out = missing.missing_pct(ts, freq="MS", tolerance=0.1)
     assert not out[0]
     assert out[1]
Exemple #3
0
 def test_pct(self, pr_hr_series):
     pr = self.pr(pr_hr_series)
     out = missing.missing_pct(pr, "D", src_timestep="H", tolerance=0.1)
     np.testing.assert_array_equal(
         out,
         9 * [
             False,
         ] + [
             True,
         ],
     )
 def test_hourly(self, pr_hr_series):
     a = np.arange(2.0 * 32 * 24)
     a[5:50] = np.nan
     pr = pr_hr_series(a)
     out = missing.missing_pct(pr, freq="MS", tolerance=0.01)
     np.testing.assert_array_equal(out, [True, False, True])