コード例 #1
0
def test_waves2dataset_defaults():
    audiolist = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    train, val, test = ([5, 4, 9, 2, 3, 10, 1, 6], [8], [7])
    value_list1, value_list2, value_list3 = featorg.waves2dataset(audiolist)
    assert train == value_list1
    assert val == value_list2
    assert test == value_list3
コード例 #2
0
def test_waves2dataset_seed_0():
    audiolist = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    train, val, test = ([7, 1, 2, 5, 6, 9, 10, 8], [4], [3])
    value_list1, value_list2, value_list3 = featorg.waves2dataset(audiolist,
                                                                  seed=0)
    assert train == value_list1
    assert val == value_list2
    assert test == value_list3
コード例 #3
0
def test_waves2dataset_train_perc_50():
    audiolist = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    train, val, test = ([5, 4, 9, 2, 3, 10], [1, 6], [8, 7])
    value_list1, value_list2, value_list3 = featorg.waves2dataset(
        audiolist, train_perc=50)
    assert train == value_list1
    assert val == value_list2
    assert test == value_list3
コード例 #4
0
def test_waves2dataset_seed_none():
    audiolist = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    train, val, test = ([7, 1, 2, 5, 6, 9, 10, 8], [4], [3])
    value_list1, value_list2, value_list3 = featorg.waves2dataset(audiolist,
                                                                  seed=None)
    assert train != value_list1
    assert val != value_list2
    assert test != value_list3
    assert len(train) == len(value_list1)
    assert len(val) == len(value_list2)
    assert len(test) == len(value_list3)
コード例 #5
0
def test_waves2dataset_indexerror_str_as_input():
    audiolist = 'can this string be separated into datasets?'
    with pytest.raises(IndexError):
        featorg.waves2dataset(audiolist)
コード例 #6
0
def test_waves2dataset_indexerror_emptylist_as_input():
    audiolist = []
    with pytest.raises(IndexError):
        featorg.waves2dataset(audiolist)