def test_dprime_invalid_data():

   with pytest.raises(cosegregation.InvalidDataError):
       cosegregation.get_dprime_from_regions(data_invalid_data)
def test_dprime_multiple_windows():

    dprime_res = cosegregation.get_dprime_from_regions(data_region_c)

    assert_array_almost_equal(dprime_res, np.array([[ 1.0, 0.541667 ],
                                                     [ 0.541667, 1.0 ]]))
def test_dprime_not_detected():

    dprime_res = cosegregation.get_dprime_from_regions(data_region_d, data_region_h)

    assert_array_almost_equal(dprime_res, np.array([[ np.nan ]]))
def test_dprime_min():

    dprime_res = cosegregation.get_dprime_from_regions(data_region_i, data_region_k)

    assert_array_almost_equal(dprime_res, np.array([[ -1.0 ]]))
def test_dprime_negative():

    dprime_res = cosegregation.get_dprime_from_regions(data_region_d, data_region_g)

    assert_array_almost_equal(dprime_res, np.array([[ -0.6 ]]))
def test_dprime_zero():

    dprime_res = cosegregation.get_dprime_from_regions(data_region_d, data_region_f)

    assert_array_almost_equal(dprime_res, np.array([[ 0.0 ]]))