예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
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
예제 #4
0
 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"
예제 #5
0
 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"
예제 #6
0
 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'