def test_missing(self, ndq_series): a = ndq_series a = ndq_series.where(~((a.time.dt.dayofyear == 5) * (a.time.dt.year == 1902))) out = streamflow.stats(a, op="max", month=1) np.testing.assert_array_equal(out[1].isnull(), False) np.testing.assert_array_equal(out[2].isnull(), True)
def test_missing(self, ndq_series): a = ndq_series a = ndq_series.where(~((a.time.dt.dayofyear == 5) * (a.time.dt.year == 1902))) assert a.shape == (5000, 2, 3) out = streamflow.stats(a, op="max", month=1) np.testing.assert_array_equal(out.sel(time="1900").isnull(), False) np.testing.assert_array_equal(out.sel(time="1902").isnull(), True)
def ts_stats(q_sim_1, tmp_path): q = xr.open_dataset(q_sim_1).q_sim ts = stats(q, op='max') fn = tmp_path / 'ts_stats.nc' ts.to_netcdf(fn) return fn
def test_simple(self, ndq_series): ts = streamflow.stats(ndq_series, freq="YS", op="max") p = streamflow.fit(ts, dist="gumbel_r") assert p.attrs["estimator"] == "Maximum likelihood"
def test_simple(self, ndq_series): out = streamflow.stats(ndq_series, freq="YS", op="min", season="MAM") assert out.attrs["units"] == "m^3 s-1"
def test_simple(self, ndq_series): out = streamflow.stats(ndq_series, freq='YS', op='min', season='MAM') assert out.attrs['units'] == 'm^3 s-1'