Exemplo n.º 1
0
def test_plot_relative_entropy(PM_da_initialized_3d, PM_da_control_3d):
    res = compute_relative_entropy(
        PM_da_initialized_3d, PM_da_control_3d, nmember_control=5, neofs=2
    )
    threshold = bootstrap_relative_entropy(
        PM_da_initialized_3d, PM_da_control_3d, nmember_control=5, neofs=2, bootstrap=2,
    )
    res_ax = plot_relative_entropy(res, threshold)
    assert res_ax is not None
Exemplo n.º 2
0
def test_bootstrap_relative_entropy(PM_da_initialized_3d, PM_da_control_3d):
    """
    Checks that there are no NaNs.
    """
    actual = bootstrap_relative_entropy(
        PM_da_initialized_3d, PM_da_control_3d, nmember_control=5, neofs=2, bootstrap=2,
    )
    actual_any_nan = actual.isnull()
    for var in actual_any_nan.data_vars:
        assert not actual_any_nan[var]