Example #1
0
def test_peek():
    data = np.arange(10).reshape(5,2)
    s = Stream(data, chunksize=3)
    xpeek = s.peek()
    assert eq(xpeek, data[:3, :])
    xfull = s.call()
    assert eq(xfull, data)
Example #2
0
def test_split():
    columns = {i: {'units': None, 'name': str(i)} for i in range(5)}
    attrs = {'columns': columns}
    s = Stream(data2, sr=1, attrs=attrs).split(1, 3)
    y = s.call()
    assert eq(data2[:, (1, 3)], y)
    assert len(s.attrs['columns']) == 2
    assert s.attrs['columns'][0]['name'] == '1'
    assert s.attrs['columns'][1]['name'] == '3'
Example #3
0
def test_stream_chunksize():
    stream = Stream(data1, sr=10, chunksize=3)
    assert eq(data1, stream.call())
Example #4
0
def test_stream():
    stream = Stream(data1, sr=10)
    assert eq(data1, stream.call())
    assert eq(data2, Stream(data2, sr=10).call())
    assert eq(data3, Stream(data3, sr=10).call())