コード例 #1
0
def test_warning():
    sig = _signal()

    with pytest.warns(VisibleDeprecationWarning, match="progressbar"):
        sig.compute(progressbar=False)

    assert sig._lazy == False
    thing = to_array(sig, chunks=None)
    assert isinstance(thing, np.ndarray)
コード例 #2
0
ファイル: test_lazy.py プロジェクト: stloeffler/hyperspy
def test_as_array_dask(sig):
    chunks = ((6, ), (9, ), (7, ), (11, ))
    thing = to_array(sig, chunks=chunks)
    assert isinstance(thing, da.Array)
    assert thing.chunks == chunks
コード例 #3
0
ファイル: test_lazy.py プロジェクト: stloeffler/hyperspy
def test_as_array_numpy(sig):
    thing = to_array(sig, chunks=None)
    assert isinstance(thing, np.ndarray)
コード例 #4
0
ファイル: test_lazy.py プロジェクト: stloeffler/hyperspy
def test_as_array_fail():
    with pytest.raises(ValueError):
        to_array('asd', chunks=None)
コード例 #5
0
ファイル: test_lazy.py プロジェクト: woozey/hyperspy
def test_as_array_dask(sig):
    chunks = ((6,), (9,), (7,), (11,))
    thing = to_array(sig, chunks=chunks)
    assert isinstance(thing, da.Array)
    assert thing.chunks == chunks
コード例 #6
0
ファイル: test_lazy.py プロジェクト: woozey/hyperspy
def test_as_array_numpy(sig):
    thing = to_array(sig, chunks=None)
    assert isinstance(thing, np.ndarray)
コード例 #7
0
ファイル: test_lazy.py プロジェクト: woozey/hyperspy
def test_as_array_fail():
    with pytest.raises(ValueError):
        to_array('asd', chunks=None)