Esempio n. 1
0
def test_adjust_sequences_5():
    x = [
        np.random.randn(128, 5),
        np.random.randn(50, 5),
        np.random.randn(100, 5),
    ]

    new = signal.adjust_sequences(x, dtype=np.float64)
    assert new.dtype == np.float64
Esempio n. 2
0
def test_adjust_sequences_3():
    x = [
        np.random.randn(128, 5),
        np.random.randn(50, 5),
        np.random.randn(100, 5),
    ]

    new = signal.adjust_sequences(x, 64)
    assert new.shape[1] == 64
Esempio n. 3
0
def test_adjust_sequences_2():
    x = [
        np.random.randn(128, 5),
        np.random.randn(50, 5),
        np.random.randn(100, 5),
    ]
    min_len = min([i.shape[0] for i in x])
    new = signal.adjust_sequences(x, np.min)
    assert min_len == new.shape[1]
Esempio n. 4
0
def test_adjust_sequences_1():
    x = [
        np.random.randn(128, 5),
        np.random.randn(50, 5),
        np.random.randn(100, 5),
    ]
    max_len = max([i.shape[0] for i in x])
    new = signal.adjust_sequences(x)
    assert max_len == new.shape[1]
Esempio n. 5
0
def test_adjust_sequences_7():
    x = [
        np.random.randn(128, 5),
        np.random.randn(50, 5),
        np.random.randn(100, 5),
    ]
    try:
        new = signal.adjust_sequences(x, fill=0.0)
        passed = True
    except Exception:
        passed = False

    assert passed
Esempio n. 6
0
def test_adjust_sequences_8():
    x = [
        np.random.randn(128, 5),
        np.random.randn(50, 5),
        np.random.randn(100, 5),
    ]
    passed = False
    try:
        new = signal.adjust_sequences(x, fill="Something")
    except TypeError:
        passed = True

    assert passed