Esempio n. 1
0
def test_bootstrap_dpp_sig50_similar_dpp(control_3d_NA):
    ds = control_3d_NA
    bootstrap = 5
    sig = 50
    actual = dpp_threshold(ds, bootstrap=bootstrap, sig=sig).drop('quantile')
    expected = dpp(ds)
    xr.testing.assert_allclose(actual, expected, atol=0.5, rtol=0.5)
Esempio n. 2
0
def test_bootstrap_dpp_sig50_similar_dpp(PM_da_control_3d):
    sig = 50
    actual = dpp_threshold(PM_da_control_3d, iterations=ITERATIONS, sig=sig).drop_vars(
        "quantile"
    )
    expected = dpp(PM_da_control_3d)
    xr.testing.assert_allclose(actual, expected, atol=0.5, rtol=0.5)
Esempio n. 3
0
def test_bootstrap_func_multiple_sig_levels(control_3d_NA):
    ds = control_3d_NA
    bootstrap = 5
    sig = [5, 95]
    actual = dpp_threshold(ds, bootstrap=bootstrap, sig=sig)
    print(actual)
    assert actual['quantile'].size == len(sig)
    assert (actual.isel(quantile=0).values <= actual.isel(quantile=1)).all()
Esempio n. 4
0
def test_bootstrap_func_multiple_sig_levels(PM_da_control_3d):
    sig = [5, 95]
    actual = dpp_threshold(PM_da_control_3d, iterations=ITERATIONS, sig=sig)
    assert actual["quantile"].size == len(sig)
    assert (actual.isel(quantile=0).values <= actual.isel(quantile=1)).all()