test_datasets.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:klusta 作者: kwikteam 项目源码 文件源码
def test_dat_file(tempdir):
    data = np.random.randint(size=(20000, 4),
                             low=-100, high=100).astype(np.int16)
    fn = 'test-4ch-1s.dat'
    _add_mock_response(_BASE_URL['github'] + 'test/' + fn,
                       data.tostring())

    path = download_test_data(fn, tempdir)
    with open(path, 'rb') as f:
        arr = np.fromfile(f, dtype=np.int16).reshape((-1, 4))
    assert arr.shape == (20000, 4)

    responses.reset()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号