Example #1
0
def test_uniquemerge2literal():
    from mvpa2.mappers.fx import _uniquemerge2literal
    assert_equal(_uniquemerge2literal(range(3)), ['0+1+2'])
    assert_equal(_uniquemerge2literal(np.arange(6).reshape(2,3)), ['[0 1 2]+[3 4 5]'])
    assert_array_equal(_uniquemerge2literal([[2,3,4]]), [[2, 3, 4]])
    assert_array_equal(_uniquemerge2literal([[2,3,4],[2,3,4]]), [[2, 3, 4]])
    assert_equal(_uniquemerge2literal([2,2,2]), [2])
    assert_array_equal(_uniquemerge2literal(['L1', 'L1']), ['L1'])
Example #2
0
def test_uniquemerge2literal():
    from mvpa2.mappers.fx import _uniquemerge2literal

    assert_equal(_uniquemerge2literal(range(3)), ["0+1+2"])
    assert_equal(_uniquemerge2literal(np.arange(6).reshape(2, 3)), ["[0 1 2]+[3 4 5]"])
    assert_array_equal(_uniquemerge2literal([[2, 3, 4]]), [[2, 3, 4]])
    assert_array_equal(_uniquemerge2literal([[2, 3, 4], [2, 3, 4]]), [[2, 3, 4]])
    assert_equal(_uniquemerge2literal([2, 2, 2]), [2])
    assert_array_equal(_uniquemerge2literal(["L1", "L1"]), ["L1"])