[Debian-astro-maintainers] Bug#1114721: spectral-cube: FTBFS with NumPy 2.3

roehling at debian.org roehling at debian.org
Mon Sep 8 20:44:41 BST 2025


Source: spectral-cube
Version: 0.6.6-3
Severity: important
User: debian-python at lists.debian.org
Usertags: numpy2.3
Tags: ftbfs, forky, sid

Dear maintainer,

During a test rebuild for NumPy 2.3, spectral-cube failed to rebuild.

Log Summary:
-------------------------------------------------------------------------------
[...]
platform linux -- Python 3.13.7, pytest-8.4.2, pluggy-1.6.0
rootdir: /build/reproducible-path/spectral-cube-0.6.6
configfile: setup.cfg
plugins: doctestplus-1.4.0, astropy-header-0.2.2, typeguard-4.4.4, hypothesis-6.138.14, remotedata-0.4.1, arraydiff-0.6.1, mock-3.14.1, cov-5.0.0, filter-subpackage-0.2.0, astropy-0.11.0
collected 1720 items

spectral_cube/spectral_axis.py .                                         [  0%]
spectral_cube/tests/test_analysis_functions.py ...................       [  1%]
spectral_cube/tests/test_casafuncs.py ......sssssssssssssss              [  2%]
spectral_cube/tests/test_cube_utils.py .......                           [  2%]
spectral_cube/tests/test_dask.py .s...s.......s                          [  3%]
spectral_cube/tests/test_io.py .......................                   [  4%]
spectral_cube/tests/test_masks.py ...................................... [  7%]
...............................................XX....                    [ 10%]
spectral_cube/tests/test_moments.py .................................... [ 12%]
........................................................................ [ 16%]
........................................................................ [ 20%]
........                                                                 [ 21%]
spectral_cube/tests/test_performance.py ...s..                           [ 21%]
spectral_cube/tests/test_projection.py .......................x......... [ 23%]
.....xxx.......x........................................................ [ 27%]
..................                                                       [ 28%]
spectral_cube/tests/test_regrid.py ..........ssss....s.................s [ 30%]
ss....sssssssssssss                                                      [ 31%]
spectral_cube/tests/test_spectral_axis.py .............................. [ 33%]
......................                                                   [ 34%]
spectral_cube/tests/test_spectral_cube.py .............................. [ 36%]
........................................................................ [ 40%]
........................................................................ [ 45%]
........................................................................ [ 49%]
..............................s.....s...........sssss................... [ 53%]
..............................ssssss......................ss............ [ 57%]
........................................................................ [ 61%]
......................................ssssss......ssssssssssss......ssss [ 65%]
ssssssss......ssssssssssss......ssssssssssss......ssssss................ [ 70%]
........................................................................ [ 74%]
..ssssss......ssssssssssss......ssssssssssss......ssssssssssss......ssss [ 78%]
ssssssss......ssssss.................................s.s..............xx [ 82%]
xx....................................................................ss [ 86%]
ss............................xxxxxxxx..............sss................F [ 91%]
.......                                                                  [ 91%]
spectral_cube/tests/test_stokes_spectral_cube.py ....................... [ 92%]
........................................................................ [ 97%]
.....                                                                    [ 97%]
spectral_cube/tests/test_subcubes.py ..ssssssssssssssssssss              [ 98%]
spectral_cube/tests/test_visualization.py ....ssssssss                   [ 99%]
spectral_cube/tests/test_wcs_utils.py ............                       [100%]

=================================== FAILURES ===================================
_________________________ test_minimal_subcube[False] __________________________

use_dask = False

    def test_minimal_subcube(use_dask):
    
        if not use_dask:
            pytest.importorskip('scipy')
    
        data = np.arange(210, dtype=float).reshape((5, 6, 7))
        data[0] = np.nan
        data[2] = np.nan
        data[4] = np.nan
        data[:,0] = np.nan
        data[:,3:4] = np.nan
        data[:, :, 0:2] = np.nan
        data[:, :, 4:7] = np.nan
    
        wcs = WCS(naxis=3)
        wcs.wcs.ctype = ['RA---TAN', 'DEC--TAN', 'VELO-HEL']
    
        cube = SpectralCube(data * u.Jy / u.beam, wcs=wcs, use_dask=use_dask)
        cube = cube.with_mask(np.isfinite(data))
    
>       subcube = cube.minimal_subcube()
                  ^^^^^^^^^^^^^^^^^^^^^^

spectral_cube/tests/test_spectral_cube.py:2757: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
spectral_cube/spectral_cube.py:1890: in minimal_subcube
    return self[self.subcube_slices_from_mask(self._mask,
spectral_cube/spectral_cube.py:1936: in subcube_slices_from_mask
    slices = ndimage.find_objects(np.broadcast_arrays(include,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

input = array([[[False, False, False, False, False, False, False],
        [False, False, False, False, False, False, False],
...        [False, False, False, False, False, False, False],
        [False, False, False, False, False, False, False]]])
max_label = np.True_

    def find_objects(input, max_label=0):
        """
        Find objects in a labeled array.
    
        Parameters
        ----------
        input : ndarray of ints
            Array containing objects defined by different labels. Labels with
            value 0 are ignored.
        max_label : int, optional
            Maximum label to be searched for in `input`. If max_label is not
            given, the positions of all objects are returned.
    
        Returns
        -------
        object_slices : list of tuples
            A list of tuples, with each tuple containing N slices (with N the
            dimension of the input array). Slices correspond to the minimal
            parallelepiped that contains the object. If a number is missing,
            None is returned instead of a slice. The label ``l`` corresponds to
            the index ``l-1`` in the returned list.
    
        See Also
        --------
        label, center_of_mass
    
        Notes
        -----
        This function is very useful for isolating a volume of interest inside
        a 3-D array, that cannot be "seen through".
    
        Examples
        --------
        >>> from scipy import ndimage
        >>> import numpy as np
        >>> a = np.zeros((6,6), dtype=int)
        >>> a[2:4, 2:4] = 1
        >>> a[4, 4] = 1
        >>> a[:2, :3] = 2
        >>> a[0, 5] = 3
        >>> a
        array([[2, 2, 2, 0, 0, 3],
               [2, 2, 2, 0, 0, 0],
               [0, 0, 1, 1, 0, 0],
               [0, 0, 1, 1, 0, 0],
               [0, 0, 0, 0, 1, 0],
               [0, 0, 0, 0, 0, 0]])
        >>> ndimage.find_objects(a)
        [(slice(2, 5, None), slice(2, 5, None)),
         (slice(0, 2, None), slice(0, 3, None)),
         (slice(0, 1, None), slice(5, 6, None))]
        >>> ndimage.find_objects(a, max_label=2)
        [(slice(2, 5, None), slice(2, 5, None)), (slice(0, 2, None), slice(0, 3, None))]
        >>> ndimage.find_objects(a == 1, max_label=2)
        [(slice(2, 5, None), slice(2, 5, None)), None]
    
        >>> loc = ndimage.find_objects(a)[0]
        >>> a[loc]
        array([[1, 1, 0],
               [1, 1, 0],
               [0, 0, 1]])
    
        """
        input = np.asarray(input)
        if np.iscomplexobj(input):
            raise TypeError('Complex type not supported')
    
        if max_label < 1:
            max_label = input.max()
    
>       return _nd_image.find_objects(input, max_label)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       TypeError: 'numpy.bool' object cannot be interpreted as an integer

/usr/lib/python3/dist-packages/scipy/ndimage/_measurements.py:308: TypeError
=========================== short test summary info ============================
FAILED spectral_cube/tests/test_spectral_cube.py::test_minimal_subcube[False]
= 1 failed, 1488 passed, 212 skipped, 17 xfailed, 2 xpassed in 240.07s (0:04:00) =
E: pybuild pybuild:389: test: plugin distutils failed with: exit code=1: cd /build/reproducible-path/spectral-cube-0.6.6/.pybuild/cpython3_3.13_spectral-cube/build; python3.13 -m pytest 
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p 3.13 returned exit code 13
make[1]: *** [debian/rules:11: override_dh_auto_test] Error 25
make[1]: Leaving directory '/build/reproducible-path/spectral-cube-0.6.6'
make: *** [debian/rules:7: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------
Build finished at 2025-09-08T11:52:06Z

-------------------------------------------------------------------------------

The above is just how the build ends and not necessarily the most relevant part.
If required, the full build log is available here (for the next 30 days):
https://debusine.debian.net/debian/developers-roehling.numpy/artifact/2456987/

About the archive rebuild: The build was made on debusine.debian.net,
using sbuild.

You can find the build task here:
https://debusine.debian.net/debian/developers-roehling.numpy/work-request/164127/

If this is really a bug in one of the build-depends, please use
reassign and affects, so that this is still visible in the BTS web
page for this package.

Cheers
Timo



More information about the Debian-astro-maintainers mailing list