def test_update_separators():
    ii1 = [True, True, False, True, True, False, True]
    ii2 = [True, True, False, True, True, False, False]
    ii3 = [False, True, False, True, True, False, False]
    ii4 = [False, True, False, True, True, False, True]
    ii5 = [True, True, True, True, True, True, True]
    iis = map(np.array, [ii1, ii2, ii3, ii4, ii5])
    ids = np.arange(len(ii1))
    for ii in iis:
        s = np.arange(np.sum(ii) + 1)
        t = reg.update_separators(s, ii)
        assert_equal(t[0], 0)
        assert_equal(t[-1], len(ii))
        assert_array_equal(ids[ii][(s[1:-2])], ids[(t[1:-2])])
示例#2
0
def test_update_separators():
    ii1 = [True, True, False, True, True, False, True]
    ii2 = [True, True, False, True, True, False, False]
    ii3 = [False, True, False, True, True, False, False]
    ii4 = [False, True, False, True, True, False, True]
    ii5 = [True, True, True, True, True, True, True]
    iis = map(np.array, [ii1, ii2, ii3, ii4, ii5])
    ids = np.arange(len(ii1))
    for ii in iis:
        s = np.arange(np.sum(ii) + 1)
        t = reg.update_separators(s, ii)
        assert_equal(t[0], 0)
        assert_equal(t[-1], len(ii))
        assert_array_equal(ids[ii][(s[1:-2])], ids[(t[1:-2])])