[Debian-med-packaging] Bug#1135061: python-anndata: tests fail with scipy 1.17: 'backed_csr_matrix' object has no attribute '_validate_indices'
Drew Parsons
dparsons at debian.org
Mon Apr 27 09:21:45 BST 2026
Source: python-anndata
Version: 0.12.7-1
Severity: normal
python-anndata is failing debci tests with scipy 1.17,
currently available in experimental
e.g. https://ci.debian.net/packages/p/python-anndata/unstable/amd64/70575515/
234s _____ test_read_array[zarr3-array_bool_subset-slice_int_subset-csr_matrix] _____
234s [gw42] linux -- Python 3.14.4 /usr/bin/python3.14
234s
234s tmp_path = PosixPath('/tmp/pytest-of-debci/pytest-0/popen-gw42/test_read_array_zarr3_array_bo0')
234s sparse_format = <class 'scipy.sparse._csr.csr_matrix'>, diskfmt = 'zarr'
234s subset_func = <function array_bool_subset at 0x7f5c7c0da4b0>
234s subset_func2 = <function slice_int_subset at 0x7f5c7c0db110>
234s
234s @pytest.mark.parametrize("sparse_format", [sparse.csr_matrix, sparse.csc_matrix])
234s @pytest.mark.parametrize(
234s ("subset_func", "subset_func2"),
234s product(
234s [
234s test_helpers.array_subset,
234s test_helpers.slice_int_subset,
234s test_helpers.array_int_subset,
234s test_helpers.array_bool_subset,
234s ],
234s repeat=2,
234s ),
234s )
234s def test_read_array(
234s tmp_path: Path,
234s sparse_format: Callable[[ArrayLike], CSMatrix],
234s diskfmt: Literal["h5ad", "zarr"],
234s subset_func,
234s subset_func2,
234s ):
234s path = tmp_path / f"test.{diskfmt.replace('ad', '')}"
234s a = sparse_format(sparse.random(100, 100))
234s obs_idx = subset_func(np.arange(100))
234s var_idx = subset_func2(np.arange(100))
234s f = open_write_group(path, mode="a") if diskfmt == "zarr" else h5py.File(path, "a")
234s ad.io.write_elem(f, "mtx", a)
234s diskmtx = sparse_dataset(f["mtx"])
234s ad.settings.use_sparse_array_on_read = True
234s > assert issubclass(type(diskmtx[obs_idx, var_idx]), CSArray)
234s ^^^^^^^^^^^^^^^^^^^^^^^^^
234s
234s tests/test_backed_sparse.py:336:
234s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
234s /usr/lib/python3/dist-packages/anndata/_core/sparse_dataset.py:461: in __getitem__
234s row_sp_matrix_validated, col_sp_matrix_validated = validate_indices(
234s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
234s
234s mtx = <Compressed Sparse Row sparse matrix of dtype 'float64'
234s with 100 stored elements and shape (100, 100)>
234s indices = (array([ True, True, True, False, True, True, False, True, False,
234s False, False, True, False, False, True... False, False, False, False, False, False, False, False, False,
234s False]), slice(np.int64(3), np.int64(43), None))
234s
234s def validate_indices(
234s mtx: BackedSparseMatrix, indices: tuple[Index1D, Index1D]
234s ) -> tuple[Index1D, Index1D]:
234s > res = mtx._validate_indices(indices)
234s ^^^^^^^^^^^^^^^^^^^^^
234s E AttributeError: 'backed_csr_matrix' object has no attribute '_validate_indices'. Did you mean: '_prepare_indices'?
234s
234s /usr/lib/python3/dist-packages/anndata/_core/sparse_dataset.py:395: AttributeError
This bug will become RC severity: serious later once scipy 1.17 is
uploaded to unstable.
More information about the Debian-med-packaging
mailing list