Skip to content

NumPy 1.12.0 has failing tests #78

Closed
@nils-werner

Description

@nils-werner

Somewhere there is auto-densification happening, as I have many failing tests on my setup:

sparse/tests/test_core.py::test_elemwise[func0] FAILED
sparse/tests/test_core.py::test_elemwise[func1] FAILED
sparse/tests/test_core.py::test_elemwise[func2] FAILED
sparse/tests/test_core.py::test_elemwise[func3] FAILED
sparse/tests/test_core.py::test_elemwise[func4] FAILED
sparse/tests/test_core.py::test_elemwise[func5] FAILED
sparse/tests/test_core.py::test_elemwise[func6] FAILED
sparse/tests/test_core.py::test_elemwise[func7] FAILED
sparse/tests/test_core.py::test_elemwise[func8] FAILED
sparse/tests/test_core.py::test_elemwise[func9] FAILED
sparse/tests/test_core.py::test_elemwise[func10] PASSED
sparse/tests/test_core.py::test_elemwise[func11] FAILED
sparse/tests/test_core.py::test_elemwise[func12] PASSED
sparse/tests/test_core.py::test_elemwise[func13] FAILED
sparse/tests/test_core.py::test_elemwise[func14] FAILED
sparse/tests/test_core.py::test_elemwise[func15] PASSED
sparse/tests/test_core.py::test_elemwise[func16] PASSED

with

func = <ufunc 'floor'>

    @pytest.mark.parametrize('func', [np.expm1, np.log1p, np.sin, np.tan,
                                      np.sinh, np.tanh, np.floor, np.ceil,
                                      np.sqrt, np.conj, np.round, np.rint,
                                      lambda x: x.astype('int32'), np.conjugate,
                                      np.conj, lambda x: x.round(decimals=2), abs])
    def test_elemwise(func):
        s = sparse.random((2, 3, 4), density=0.5)
        x = s.todense()

        fs = func(s)

>       assert isinstance(fs, COO)
E       assert False
E        +  where False = isinstance(array([[[ 0.,  0.,  0.,  0.],\n        [ 0.,  0.,  0.,  0.],\n        [ 0.,  0.,  0.,  0.]],\n\n       [[ 0.,  0.,  0.,  0.],\n        [ 0.,  0.,  0.,  0.],\n        [ 0.,  0.,  0.,  0.]]]), COO)

Additionally, the two tests

sparse/tests/test_core.py::test_addition_not_ok_when_large_and_sparse
sparse/tests/test_core.py::test_raise_dense

basically never finish (I aborted them using Ctrl+C).

To reproduce this behaviour you can use the following tox.ini file

[tox]
envlist = {py27,py36}-{numpy12,numpylatest}
[testenv]
deps =
    numpy12: numpy==1.12.0
basepython =
    py27: python2.7
    py36: python3.6
commands=
    pip list
    py.test {posargs}
extras=
    docs
    tests

and run the specific tests using

tox -e py36-numpy12 -- -k test_elemwise
tox -e py36-numpy12 -- -k test_addition_not_ok_when_large_and_sparse
tox -e py36-numpy12 -- -k test_raise_dense

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorwontfixIndicates that work won't continue on an issue, pull request, or discussion

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions