def test_too_short(self, q_series): """Missing if less than 20 values are present.""" q = q_series(np.random.rand(21)) out = land.fit(q, dist="norm") assert not np.isnan(out.values[0]) q = q_series(np.random.rand(19)) out = land.fit(q, dist="norm") assert np.isnan(out.values[0])
def test_nan(self, q_series): r = np.random.rand(22) r[0] = np.nan q = q_series(r) out = land.fit(q, dist="norm") assert not np.isnan(out.values[0])
def test_options(self, q_series): q = q_series(np.random.rand(19)) with set_options(missing_options={"at_least_n": {"n": 10}}): out = land.fit(q, dist="norm") np.testing.assert_array_equal(out.isnull(), False)
def test_ndim(self, ndq_series): out = land.fit(ndq_series, dist="norm") assert out.shape == (2, 2, 3) np.testing.assert_array_equal(out.isnull(), False)
def test_simple(self, ndq_series): ts = land.stats(ndq_series, freq="YS", op="max") p = land.fit(ts, dist="gumbel_r") assert p.attrs["estimator"] == "Maximum likelihood"