Bug#1026347: python-dtcwt: autopkgtest needs update for new version of numpy: IndexError

Paul Gevers elbrus at debian.org
Sun Dec 18 20:19:04 GMT 2022


Source: python-dtcwt
Version: 0.12.0-3
Severity: serious
X-Debbugs-CC: numpy at packages.debian.org
Tags: sid bookworm
User: debian-ci at lists.debian.org
Usertags: needs-update
Control: affects -1 src:numpy

Dear maintainer(s),

With a recent upload of numpy the autopkgtest of python-dtcwt fails in 
testing when that autopkgtest is run with the binary packages of numpy 
from unstable. It passes when run with only packages from testing. In 
tabular form:

                        pass            fail
numpy                  from testing    1:1.23.5-2
python-dtcwt           from testing    0.12.0-3
all others             from testing    from testing

I copied some of the output at the bottom of this report.

Currently this regression is blocking the migration of numpy to testing 
[1]. Of course, numpy shouldn't just break your autopkgtest (or even 
worse, your package), but it seems to me that the change in numpy was 
intended and your package needs to update to the new situation.

If this is a real problem in your package (and not only in your 
autopkgtest), the right binary package(s) from numpy should really add a 
versioned Breaks on the unfixed version of (one of your) package(s). 
Note: the Breaks is nice even if the issue is only in the autopkgtest as 
it helps the migration software to figure out the right versions to 
combine in the tests.

More information about this bug and the reason for filing it can be found on
https://wiki.debian.org/ContinuousIntegration/RegressionEmailInformation

Paul

[1] https://qa.debian.org/excuses.php?package=numpy

https://ci.debian.net/data/autopkgtest/testing/amd64/p/python-dtcwt/29465794/log.gz

=================================== FAILURES 
===================================
_______________________________ test_estimatereg 
_______________________________

     def test_estimatereg():
         nlevels = 6
         trans = Transform2d()
         t1 = trans.forward(f1, nlevels=nlevels)
         t2 = trans.forward(f2, nlevels=nlevels)
>       avecs = estimatereg(t1, t2)

tests/test_registration.py:31: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3/dist-packages/dtcwt/registration.py:368: in estimatereg
     qts += dtcwt.sampling.rescale(_boxfilter(x, 3), avecs.shape[:2], 
method='bilinear')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _
X = array([[[ 1.20862440e+05, -6.87922429e+02,  0.00000000e+00, ...,
           0.00000000e+00,  0.00000000e+00,  0.0000000...[ 
9.03364731e+04, -2.12328587e+03,  8.28084336e+04, ...,
           4.19311988e+01, -4.19288899e+01,  4.06605564e+01]]])
kernel_size = 3

     def _boxfilter(X, kernel_size):
         """
         INTERNAL
             A simple box filter implementation.
             """
         if kernel_size % 2 == 0:
             raise ValueError('Kernel size must be odd')
             for axis_idx in xrange(2):
             slices = [slice(None),] * len(X.shape)
             out = X
                 for delta in xrange(1, 1+(kernel_size-1)//2):
                 slices[axis_idx] = dtcwt.utils.reflect(
                         np.arange(X.shape[axis_idx]) + delta, -0.5, 
X.shape[axis_idx]-0.5)
>               out = out + X[slices]
E               IndexError: only integers, slices (`:`), ellipsis 
(`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid 
indices

/usr/lib/python3/dist-packages/dtcwt/registration.py:439: IndexError
=============================== warnings summary 
===============================
tests/test_againstmatlab.py: 1 warning
tests/test_colifilt.py: 3 warnings
tests/test_ifm1.py: 12 warnings
tests/test_ifm2.py: 54 warnings
tests/test_xfm1.py: 14 warnings
tests/test_xfm2.py: 26 warnings
tests/test_xfm3.py: 2208 warnings
   /usr/lib/python3/dist-packages/dtcwt/numpy/lowlevel.py:236: 
DeprecationWarning: `np.int` is a deprecated alias for the builtin 
`int`. To silence this warning, use `int` by itself. Doing this will not 
modify any behavior and is safe. When replacing `np.int`, you may wish 
to use e.g. `np.int64` or `np.int32` to specify the precision. If you 
wish to review your current use, check the release note link for 
additional information.
   Deprecated in NumPy 1.20; for more details and guidance: 
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
     xe = reflect(np.arange(-m2, r+m2, dtype=np.int), -0.5, r-0.5)

tests/test_againstmatlab.py: 1299 warnings
tests/test_colfilter.py: 6 warnings
tests/test_ifm1.py: 12 warnings
tests/test_ifm2.py: 48 warnings
tests/test_registration.py: 12 warnings
tests/test_xfm1.py: 24 warnings
tests/test_xfm2.py: 98 warnings
tests/test_xfm3.py: 7788 warnings
   /usr/lib/python3/dist-packages/dtcwt/numpy/lowlevel.py:74: 
DeprecationWarning: `np.int` is a deprecated alias for the builtin 
`int`. To silence this warning, use `int` by itself. Doing this will not 
modify any behavior and is safe. When replacing `np.int`, you may wish 
to use e.g. `np.int64` or `np.int32` to specify the precision. If you 
wish to review your current use, check the release note link for 
additional information.
   Deprecated in NumPy 1.20; for more details and guidance: 
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
     xe = reflect(np.arange(-m2, r+m2, dtype=np.int), -0.5, r-0.5)

tests/test_againstmatlab.py: 4 warnings
tests/test_registration.py: 24 warnings
tests/test_sampling.py: 82 warnings
   /usr/lib/python3/dist-packages/dtcwt/sampling.py:38: 
DeprecationWarning: `np.int` is a deprecated alias for the builtin 
`int`. To silence this warning, use `int` by itself. Doing this will not 
modify any behavior and is safe. When replacing `np.int`, you may wish 
to use e.g. `np.int64` or `np.int32` to specify the precision. If you 
wish to review your current use, check the release note link for 
additional information.
   Deprecated in NumPy 1.20; for more details and guidance: 
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
     sym_xs = reflect(xs, -0.5, im.shape[1]-0.5).astype(np.int)

tests/test_againstmatlab.py: 4 warnings
tests/test_registration.py: 24 warnings
tests/test_sampling.py: 82 warnings
   /usr/lib/python3/dist-packages/dtcwt/sampling.py:39: 
DeprecationWarning: `np.int` is a deprecated alias for the builtin 
`int`. To silence this warning, use `int` by itself. Doing this will not 
modify any behavior and is safe. When replacing `np.int`, you may wish 
to use e.g. `np.int64` or `np.int32` to specify the precision. If you 
wish to review your current use, check the release note link for 
additional information.
   Deprecated in NumPy 1.20; for more details and guidance: 
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
     sym_ys = reflect(ys, -0.5, im.shape[0]-0.5).astype(np.int)

tests/test_colifilt.py::test_output_size_non_mult_4
tests/test_colifilt.py::test_non_orthogonal_input_non_mult_4
   /usr/lib/python3/dist-packages/dtcwt/numpy/lowlevel.py:209: 
DeprecationWarning: `np.int` is a deprecated alias for the builtin 
`int`. To silence this warning, use `int` by itself. Doing this will not 
modify any behavior and is safe. When replacing `np.int`, you may wish 
to use e.g. `np.int64` or `np.int32` to specify the precision. If you 
wish to review your current use, check the release note link for 
additional information.
   Deprecated in NumPy 1.20; for more details and guidance: 
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
     xe = reflect(np.arange(-m2, r+m2, dtype=np.int), -0.5, r-0.5)

tests/test_ifm2.py::test_reconstruct_crop
tests/test_xfm2.py::test_odd_cols_w_scale
tests/test_xfm2.py::test_odd_rows_and_cols_w_scale
   /usr/lib/python3/dist-packages/dtcwt/numpy/transform2d.py:165: 
DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
     logging.warn('The image entered is now a {0} NOT a {1}.'.format(

tests/test_ifm2.py::test_reconstruct_crop
tests/test_xfm2.py::test_odd_cols_w_scale
tests/test_xfm2.py::test_odd_rows_and_cols_w_scale
   /usr/lib/python3/dist-packages/dtcwt/numpy/transform2d.py:168: 
DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
     logging.warn(

tests/test_registration.py::test_estimatereg
   /usr/lib/python3/dist-packages/dtcwt/registration.py:439: 
VisibleDeprecationWarning: Creating an ndarray from ragged nested 
sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with 
different lengths or shapes) is deprecated. If you meant to do this, you 
must specify 'dtype=object' when creating the ndarray.
     out = out + X[slices]

tests/test_xfm2.py::test_1d
tests/test_xfm2.py::test_odd_rows
tests/test_xfm2.py::test_odd_rows_w_scale
   /usr/lib/python3/dist-packages/dtcwt/numpy/transform2d.py:172: 
DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
     logging.warn('The image entered is now a {0} NOT a {1}.'.format(

tests/test_xfm2.py::test_1d
tests/test_xfm2.py::test_odd_rows
tests/test_xfm2.py::test_odd_rows_w_scale
   /usr/lib/python3/dist-packages/dtcwt/numpy/transform2d.py:175: 
DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
     logging.warn(

tests/test_xfm2.py::test_odd_cols
tests/test_xfm2.py::test_odd_rows_and_cols
   /usr/lib/python3/dist-packages/dtcwt/numpy/transform2d.py:179: 
DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
     logging.warn('The image entered is now a {0} NOT a {1}.'.format(

tests/test_xfm2.py::test_odd_cols
tests/test_xfm2.py::test_odd_rows_and_cols
   /usr/lib/python3/dist-packages/dtcwt/numpy/transform2d.py:182: 
DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
     logging.warn(

tests/test_xfm3.py::test_integer_input
 
/tmp/autopkgtest-lxc._a7ghh_d/downtmp/autopkgtest_tmp/tests/test_xfm3.py:126: 
DeprecationWarning: `np.int` is a deprecated alias for the builtin 
`int`. To silence this warning, use `int` by itself. Doing this will not 
modify any behavior and is safe. When replacing `np.int`, you may wish 
to use e.g. `np.int64` or `np.int32` to specify the precision. If you 
wish to review your current use, check the release note link for 
additional information.
   Deprecated in NumPy 1.20; for more details and guidance: 
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
     Yl, Yh = dtwavexfm3(np.ones((4,4,4), dtype=np.int))

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info 
============================
FAILED tests/test_registration.py::test_estimatereg - IndexError: only 
intege...
========= 1 failed, 124 passed, 214 skipped, 11845 warnings in 10.71s 
==========
autopkgtest [09:24:11]: test command1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20221218/6f1dd5d1/attachment.sig>


More information about the debian-science-maintainers mailing list