[Debian-med-packaging] Bug#1075928: python-anndata: tests fail with scipy 1.13
Drew Parsons
dparsons at debian.org
Sun Jul 7 23:25:44 BST 2024
Source: python-anndata
Version: 0.10.6-1
Severity: normal
python-anndata is failing tests with scipy 1.13,
likely due to use of deprecated API
https://ci.debian.net/packages/p/python-anndata/unstable/arm64/48727323/
295s _____________ test_backed_indexing[array_subset-array_subset-h5ad] _____________
295s
295s ondisk_equivalent_adata = (AnnData object with n_obs × n_vars = 50 × 50, AnnData object with n_obs × n_vars = 50 × 50 backed at '/tmp/pytest-of-...ect with n_obs × n_vars = 50 × 50 backed at '/tmp/pytest-of-debci/pytest-0/test_backed_indexing_array_sub0/dense.h5ad')
295s subset_func = <function array_subset at 0xffffb3096160>
295s subset_func2 = <function array_subset at 0xffffb3096160>
295s
295s def test_backed_indexing(
295s ondisk_equivalent_adata: tuple[AnnData, AnnData, AnnData, AnnData],
295s subset_func,
295s subset_func2,
295s ):
295s csr_mem, csr_disk, csc_disk, dense_disk = ondisk_equivalent_adata
295s
295s obs_idx = subset_func(csr_mem.obs_names)
295s var_idx = subset_func2(csr_mem.var_names)
295s
295s > assert_equal(csr_mem[obs_idx, var_idx].X, csr_disk[obs_idx, var_idx].X)
295s
295s tests/test_backed_sparse.py:115:
295s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
295s /usr/lib/python3/dist-packages/anndata/_core/anndata.py:586: in X
295s X = _subset(X, (self._oidx, self._vidx))
295s /usr/lib/python3.11/functools.py:909: in wrapper
295s return dispatch(args[0].__class__)(*args, **kw)
295s /usr/lib/python3/dist-packages/anndata/_core/sparse_dataset.py:608: in subset_sparsedataset
295s return d[subset_idx]
295s /usr/lib/python3/dist-packages/anndata/_core/sparse_dataset.py:427: in __getitem__
295s sub = mtx[row, col]
295s /usr/lib/python3/dist-packages/scipy/sparse/_index.py:91: in __getitem__
295s return self._get_columnXarray(row[:,0], col.ravel())
295s /usr/lib/python3/dist-packages/scipy/sparse/_compressed.py:688: in _get_columnXarray
295s return self._major_index_fancy(major)._minor_index_fancy(minor)
295s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
295s
295s self = <50x50 sparse matrix of type '<class 'numpy.float64'>'
295s with 250 stored elements in Compressed Sparse Row format>
295s idx = array([38, 45, 41, 29, 47, 6, 10, 28, 42, 5, 9, 26, 48, 33])
295s
295s def _major_index_fancy(self, idx):
295s """Index along the major axis where idx is an array of ints.
295s """
295s idx_dtype = self._get_index_dtype((self.indptr, self.indices))
295s indices = np.asarray(idx, dtype=idx_dtype).ravel()
295s
295s _, N = self._swap(self.shape)
295s M = len(indices)
295s new_shape = self._swap((M, N))
295s if M == 0:
295s return self.__class__(new_shape, dtype=self.dtype)
295s
295s row_nnz = (self.indptr[indices + 1] - self.indptr[indices]).astype(idx_dtype)
295s
295s res_indptr = np.zeros(M+1, dtype=idx_dtype)
295s np.cumsum(row_nnz, out=res_indptr[1:])
295s
295s nnz = res_indptr[-1]
295s res_indices = np.empty(nnz, dtype=idx_dtype)
295s res_data = np.empty(nnz, dtype=self.dtype)
295s csr_row_index(
295s M,
295s indices,
295s self.indptr.astype(idx_dtype, copy=False),
295s > self.indices.astype(idx_dtype, copy=False),
295s self.data,
295s res_indices,
295s res_data
295s )
295s E TypeError: Dataset.astype() got an unexpected keyword argument 'copy'
295s
295s /usr/lib/python3/dist-packages/scipy/sparse/_compressed.py:714: TypeError
scipy 1.12 was recently uploaded to unstable, but upstream has already
released 1.14, so we'll want to push scipy 1.13 to unstable in the
near future.
More information about the Debian-med-packaging
mailing list