Bug#988424: python-sparse: failure in tests

Ritesh Raj Sarraf rrs at debian.org
Wed May 12 17:53:01 BST 2021


Package: python-sparse
Severity: important
Tags: ftbfs
User: devel at lists.apertis.org
Usertags: apertis-ftbfs
X-Debbugs-Cc: devel at lists.apertis.org

Dear Maintainer,

It turns out that the package seems to be failing in some of the tests
on 32 bit systems.

=================================== FAILURES ===================================
______________________ [doctest] sparse._common.full_like ______________________
1384 
1385     Returns
1386     -------
1387     out : SparseArray
1388         Array of `fill_value` with the same shape and type as `a`.
1389 
1390     Examples
1391     --------
1392     >>> x = np.ones((2, 3), dtype='i8')
1393     >>> full_like(x, 9.0).todense()  # doctest: +NORMALIZE_WHITESPACE
Expected:
    array([[9, 9, 9],
           [9, 9, 9]])
Got:
    array([[9, 9, 9],
           [9, 9, 9]], dtype=int64)

/srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build/sparse/_common.py:1393: DocTestFailure
______________________ [doctest] sparse._common.ones_like ______________________
1537 
1538     Returns
1539     -------
1540     out : SparseArray
1541         Array of ones with the same shape and type as `a`.
1542 
1543     Examples
1544     --------
1545     >>> x = np.ones((2, 3), dtype='i8')
1546     >>> ones_like(x).todense()  # doctest: +NORMALIZE_WHITESPACE
Expected:
    array([[1, 1, 1],
           [1, 1, 1]])
Got:
    array([[1, 1, 1],
           [1, 1, 1]], dtype=int64)

/srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build/sparse/_common.py:1546: DocTestFailure
_____________________ [doctest] sparse._common.zeros_like ______________________
1461 
1462     Returns
1463     -------
1464     out : SparseArray
1465         Array of zeros with the same shape and type as `a`.
1466 
1467     Examples
1468     --------
1469     >>> x = np.ones((2, 3), dtype='i8')
1470     >>> zeros_like(x).todense()  # doctest: +NORMALIZE_WHITESPACE
Expected:
    array([[0, 0, 0],
           [0, 0, 0]])
Got:
    array([[0, 0, 0],
           [0, 0, 0]], dtype=int64)

/srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build/sparse/_common.py:1470: DocTestFailure
__________________________ [doctest] sparse._dok.DOK ___________________________
056     <DOK: shape=(5, 5), dtype=int64, nnz=4, fill_value=0>
057 
058     You can convert :obj:`DOK` arrays to :obj:`COO` arrays, or :obj:`numpy.ndarray`
059     objects.
060 
061     >>> from sparse import COO
062     >>> s3 = COO(s2)
063     >>> s3
064     <COO: shape=(5, 5), dtype=int64, nnz=4, fill_value=0>
065     >>> s2.todense()  # doctest: +NORMALIZE_WHITESPACE
Differences (unified diff with -expected +actual):
    @@ -3,3 +3,3 @@
            [0, 6, 7, 0, 0],
            [0, 0, 0, 0, 0],
    -       [0, 0, 0, 0, 0]])
    +       [0, 0, 0, 0, 0]], dtype=int64)

/srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build/sparse/_dok.py:65: DocTestFailure
___________________ [doctest] sparse._slicing.sanitize_index ___________________
144 Sanitize the elements for indexing along one axis
145     >>> sanitize_index([2, 3, 5])
146     array([2, 3, 5])
147     >>> sanitize_index([True, False, True, False])
Expected:
    array([0, 2])
Got:
    array([0, 2], dtype=int32)

/srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build/sparse/_slicing.py:147: DocTestFailure
____________________ [doctest] sparse._coo.common.argwhere _____________________
586 
587     See Also
588     --------
589     :obj:`where`, :obj:`COO.nonzero`
590 
591     Examples
592     --------
593     >>> import sparse
594     >>> x = sparse.COO(np.arange(6).reshape((2, 3)))
595     >>> sparse.argwhere(x > 1)
Differences (unified diff with -expected +actual):
    @@ -2,3 +2,3 @@
            [1, 0],
            [1, 1],
    -       [1, 2]])
    +       [1, 2]], dtype=int32)

/srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build/sparse/_coo/common.py:595: DocTestFailure
________________________ [doctest] sparse._coo.core.COO ________________________
070     You can create :obj:`COO` objects from Numpy arrays.
071 
072     >>> x = np.eye(4, dtype=np.uint8)
073     >>> x[2, 3] = 5
074     >>> s = COO.from_numpy(x)
075     >>> s
076     <COO: shape=(4, 4), dtype=uint8, nnz=5, fill_value=0>
077     >>> s.data  # doctest: +NORMALIZE_WHITESPACE
078     array([1, 1, 1, 5, 1], dtype=uint8)
079     >>> s.coords  # doctest: +NORMALIZE_WHITESPACE
Expected:
    array([[0, 1, 2, 2, 3],
           [0, 1, 2, 3, 3]])
Got:
    array([[0, 1, 2, 2, 3],
           [0, 1, 2, 3, 3]], dtype=int32)

/srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build/sparse/_coo/core.py:79: DocTestFailure
_________________ [doctest] sparse._coo.core.COO._sort_indices _________________
1542         Sorts the :obj:`COO.coords` attribute. Also sorts the data in
1543         :obj:`COO.data` to match.
1544 
1545         Examples
1546         --------
1547         >>> coords = np.array([[1, 2, 0]], dtype=np.uint8)
1548         >>> data = np.array([4, 1, 3], dtype=np.uint8)
1549         >>> s = COO(coords, data)
1550         >>> s._sort_indices()
1551         >>> s.coords  # doctest: +NORMALIZE_WHITESPACE
Expected:
    array([[0, 1, 2]])
Got:
    array([[0, 1, 2]], dtype=int32)

/srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build/sparse/_coo/core.py:1551: DocTestFailure
________________ [doctest] sparse._coo.core.COO._sum_duplicates ________________
1570         --------
1571         scipy.sparse.coo_matrix.sum_duplicates : Equivalent Scipy function.
1572 
1573         Examples
1574         --------
1575         >>> coords = np.array([[0, 1, 1, 2]], dtype=np.uint8)
1576         >>> data = np.array([6, 5, 2, 2], dtype=np.uint8)
1577         >>> s = COO(coords, data)
1578         >>> s._sum_duplicates()
1579         >>> s.coords  # doctest: +NORMALIZE_WHITESPACE
Expected:
    array([[0, 1, 2]])
Got:
    array([[0, 1, 2]], dtype=int32)

/srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build/sparse/_coo/core.py:1579: DocTestFailure
__________________ [doctest] sparse._coo.core.COO.linear_loc ___________________
1244 
1245         See Also
1246         --------
1247         :obj:`numpy.flatnonzero` : Equivalent Numpy function.
1248 
1249         Examples
1250         --------
1251         >>> x = np.eye(5)
1252         >>> s = COO.from_numpy(x)
1253         >>> s.linear_loc()  # doctest: +NORMALIZE_WHITESPACE
Expected:
    array([ 0,  6, 12, 18, 24])
Got:
    array([ 0,  6, 12, 18, 24], dtype=int32)

/srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build/sparse/_coo/core.py:1253: DocTestFailure
____________________ [doctest] sparse._coo.core.COO.nbytes _____________________
614         See Also
615         --------
616         numpy.ndarray.nbytes : The equivalent Numpy property.
617 
618         Examples
619         --------
620         >>> data = np.arange(6, dtype=np.uint8)
621         >>> coords = np.random.randint(1000, size=(3, 6), dtype=np.uint16)
622         >>> s = COO(coords, data, shape=(1000, 1000, 1000))
623         >>> s.nbytes
Expected:
    150
Got:
    78

/srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build/sparse/_coo/core.py:623: DocTestFailure
____________________ [doctest] sparse._coo.core.COO.nonzero ____________________
1763 
1764         Raises
1765         ------
1766         ValueError
1767             If the array doesn't have zero fill-values.
1768 
1769         Examples
1770         --------
1771         >>> s = COO.from_numpy(np.eye(5))
1772         >>> s.nonzero()
Expected:
    (array([0, 1, 2, 3, 4]), array([0, 1, 2, 3, 4]))
Got:
    (array([0, 1, 2, 3, 4], dtype=int32), array([0, 1, 2, 3, 4], dtype=int32))

/srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build/sparse/_coo/core.py:1772: DocTestFailure
_________________ [doctest] sparse._coo.indexing._filter_pairs _________________
EXAMPLE LOCATION UNKNOWN, not showing all tests of that example
??? >>> _filter_pairs(starts, stops, coords, indices)
Expected:
    ListType[int64]([2, 4, 6])
Got:
    ListType[int32]([2, 4, 6])

/srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build/sparse/_coo/indexing.py:None: DocTestFailure
________________ [doctest] sparse._coo.indexing._get_mask_pairs ________________
EXAMPLE LOCATION UNKNOWN, not showing all tests of that example
??? >>> _get_mask_pairs(starts_old, stops_old, c, idx)
Expected:
    (ListType[int64]([4]), ListType[int64]([6]), 2)
Got:
    (ListType[int32]([4]), ListType[int32]([6]), 2)

/srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build/sparse/_coo/indexing.py:None: DocTestFailure
_____________ [doctest] sparse._coo.indexing._ind_ar_from_indices ______________
197         Input indices (slices and integers)
198 
199     Returns
200     -------
201     ind_ar : np.ndarray
202         The output array.
203 
204     Examples
205     --------
206     >>> _ind_ar_from_indices([1])
Expected:
    array([[1, 2, 1]])
Got:
    array([[1, 2, 1]], dtype=int32)

/srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build/sparse/_coo/indexing.py:206: DocTestFailure
_____________ [doctest] sparse._coo.indexing._join_adjacent_pairs ______________
EXAMPLE LOCATION UNKNOWN, not showing all tests of that example
??? >>> _join_adjacent_pairs(starts, stops)
Expected:
    (ListType[int64]([2]), ListType[int64]([7]))
Got:
    (ListType[int32]([2]), ListType[int32]([7]))

/srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build/sparse/_coo/indexing.py:None: DocTestFailure
=========================== short test summary info ============================
FAILED sparse/_common.py::sparse._common.full_like
FAILED sparse/_common.py::sparse._common.ones_like
FAILED sparse/_common.py::sparse._common.zeros_like
FAILED sparse/_dok.py::sparse._dok.DOK
FAILED sparse/_slicing.py::sparse._slicing.sanitize_index
FAILED sparse/_coo/common.py::sparse._coo.common.argwhere
FAILED sparse/_coo/core.py::sparse._coo.core.COO
FAILED sparse/_coo/core.py::sparse._coo.core.COO._sort_indices
FAILED sparse/_coo/core.py::sparse._coo.core.COO._sum_duplicates
FAILED sparse/_coo/core.py::sparse._coo.core.COO.linear_loc
FAILED sparse/_coo/core.py::sparse._coo.core.COO.nbytes
FAILED sparse/_coo/core.py::sparse._coo.core.COO.nonzero
FAILED sparse/_coo/indexing.py::sparse._coo.indexing._filter_pairs
FAILED sparse/_coo/indexing.py::sparse._coo.indexing._get_mask_pairs
FAILED sparse/_coo/indexing.py::sparse._coo.indexing._ind_ar_from_indices
FAILED sparse/_coo/indexing.py::sparse._coo.indexing._join_adjacent_pairs
===== 16 failed, 4370 passed, 1 skipped, 30 xfailed, 35 xpassed in 45.83s ======
E: pybuild pybuild:353: test: plugin distutils failed with: exit code=1: cd /srv/build/python-sparse-0.11.2/.pybuild/cpython3_3.9_sparse/build; python3.9 -m pytest 
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p 3.9 returned exit code 13
make: *** [debian/rules:12: binary] Error 255
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
Command `dpkg-buildpackage --changes-option=-DDistribution=bullseye` failed.
gbp:error: '/home/rrs/bin/gbp-pbuilder' failed: it exited with 2



-- System Information:
Debian Release: 11.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'stable-updates'), (500, 'unstable'), (500, 'stable'), (100, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-6-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_USER
Locale: LANG=en_IN.UTF-8, LC_CTYPE=en_IN.UTF-8 (charmap=UTF-8), LANGUAGE=en_US
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages python-sparse depends on:
ii  libamd2                          1:5.8.1+dfsg-2
ii  libatlas3-base [liblapack.so.3]  3.10.3-10
ii  libblas3 [libblas.so.3]          3.9.0-3
ii  libc6                            2.31-12
ii  liblapack3 [liblapack.so.3]      3.9.0-3
pn  libsuperlu5                      <none>
ii  libumfpack5                      1:5.8.1+dfsg-2
pn  python                           <none>
pn  python-numpy                     <none>
pn  python-numpy-abi9                <none>

python-sparse recommends no packages.

Versions of packages python-sparse suggests:
pn  python-sparse-examples  <none>



More information about the debian-science-maintainers mailing list