コード例 #1
0
ファイル: test_fxmapper.py プロジェクト: neurosbh/PyMVPA
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'])
コード例 #2
0
ファイル: test_fxmapper.py プロジェクト: kirtyvedula/PyMVPA
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"])