Your message dated Sun, 30 Dec 2018 17:34:41 +0000
with message-id <e1gdez3-000enm...@fasolo.debian.org>
and subject line Bug#917353: fixed in skimage 0.14.1-3
has caused the Debian Bug report #917353,
regarding [python3-skimage] Cannot import skimage with new numpy
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
917353: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=917353
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: python3-skimage
Version: 0.14.1-2
Severity: serious
Affects: python3-ccdproc, python3-hipspy, python3-sunpy
Tags: patch
Control: forwarded -1 https://github.com/scikit-image/scikit-image/issues/3551

$ python3
Python 3.7.2rc1 (default, Dec 12 2018, 06:25:49) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import skimage
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/skimage/__init__.py", line 167, in 
<module>
    from .util.dtype import (img_as_float32,
  File "/usr/lib/python3/dist-packages/skimage/util/__init__.py", line 8, in 
<module>
    from .arraycrop import crop
  File "/usr/lib/python3/dist-packages/skimage/util/arraycrop.py", line 8, in 
<module>
    from numpy.lib.arraypad import _validate_lengths
ImportError: cannot import name '_validate_lengths' from 'numpy.lib.arraypad' 
(/usr/lib/python3/dist-packages/numpy/lib/arraypad.py)

This happens in the CI tests on a number of packages after the update of numpy 
(see "Affects").

Since `_validate_lengths` is an internal identifies by Python convention, the 
bug is clearly in skimage.

It is resolved in 

https://github.com/scikit-image/scikit-image/pull/3556

For convenience, a patch is attached.

Cheers

Ole
From: Egor Panfilov <egor.v.panfi...@gmail.com>
Date: Thu, 22 Nov 2018 22:16:02 +0200
Subject: Handle deprecation of numpy `_validate_lengths`

https://github.com/scikit-image/scikit-image/pull/3561
https://github.com/scikit-image/scikit-image/pull/3556
https://github.com/scikit-image/scikit-image/issues/3551
---
 skimage/util/arraycrop.py | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/skimage/util/arraycrop.py b/skimage/util/arraycrop.py
index e83a6c6..3787770 100644
--- a/skimage/util/arraycrop.py
+++ b/skimage/util/arraycrop.py
@@ -5,8 +5,15 @@ n-dimensional array.
 from __future__ import division, absolute_import, print_function
 
 import numpy as np
-from numpy.lib.arraypad import _validate_lengths
 
+# After numpy 1.15, a new backward compatible function have been implemented.
+# See https://github.com/numpy/numpy/pull/11966
+from distutils.version import LooseVersion as Version
+old_numpy = Version(np.__version__) < Version('1.16')
+if old_numpy:
+    from numpy.lib.arraypad import _validate_lengths
+else:
+    from numpy.lib.arraypad import _as_pairs
 
 __all__ = ['crop']
 
@@ -169,7 +176,10 @@ def crop(ar, crop_width, copy=False, order='K'):
         view of the input array.
     """
     ar = np.array(ar, copy=False)
-    crops = _validate_lengths(ar, crop_width)
+    if old_numpy:
+        crops = _validate_lengths(ar, crop_width)
+    else:
+        crops = _as_pairs(crop_width, ar.ndim, as_index=True)
     slices = tuple(slice(a, ar.shape[i] - b)
                    for i, (a, b) in enumerate(crops))
     if copy:

--- End Message ---
--- Begin Message ---
Source: skimage
Source-Version: 0.14.1-3

We believe that the bug you reported is fixed in the latest version of
skimage, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 917...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Ole Streicher <oleb...@debian.org> (supplier of updated skimage package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 30 Dec 2018 18:12:33 +0100
Source: skimage
Binary: python-skimage python3-skimage python-skimage-doc python-skimage-lib 
python3-skimage-lib
Architecture: source
Version: 0.14.1-3
Distribution: unstable
Urgency: medium
Maintainer: Debian Science Maintainers 
<debian-science-maintain...@lists.alioth.debian.org>
Changed-By: Ole Streicher <oleb...@debian.org>
Description:
 python-skimage - Python modules for image processing
 python-skimage-doc - Documentation and examples for scikit-image
 python-skimage-lib - Optimized low-level algorithms for scikit-image
 python3-skimage - Python 3 modules for image processing
 python3-skimage-lib - Optimized low-level algorithms for Python 3 scikit-image
Closes: 917353
Changes:
 skimage (0.14.1-3) unstable; urgency=medium
 .
   * Team upload
 .
   [ yangfl ]
   * Code cleanup
   * Use Agg MPL backend for autopkgtests
 .
   [ Ole Streicher ]
   * Handle deprecation of numpy (Closes: #917353)
   * Fix test_mpl_imshow
   * Add cloudpickle to build dependencies
 .
   [ Andreas Tille ]
   * Respect DEB_BUILD_OPTIONS in override_dh_auto_test target
   * Standards-Version: 4.3.0
   * cme fix dpkg-control
Checksums-Sha1:
 1308726e1eeda576112934490ca5bb24327e02f6 3168 skimage_0.14.1-3.dsc
 1abec268c4b55cb58f9983d2bb0e0e048321bd71 24420 skimage_0.14.1-3.debian.tar.xz
Checksums-Sha256:
 7bd76e786b0641ac2d0edcdd7d57858db639945de4db9ac6e07cbb585425b0d6 3168 
skimage_0.14.1-3.dsc
 d07b8a824e27a1694c804ca0dc710d54ed64e4fb008a0d5206577876a7ff71bf 24420 
skimage_0.14.1-3.debian.tar.xz
Files:
 a27fa49bd3aa256b5814237ce9f1f6f4 3168 python optional skimage_0.14.1-3.dsc
 4c0489acf80ee90fa6e4c97f8c372c01 24420 python optional 
skimage_0.14.1-3.debian.tar.xz

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEuvxshffLFD/utvsVcRWv0HcQ3PcFAlwo/fwACgkQcRWv0HcQ
3PcnKA//XSNerqEgvqLdoagNMNzneKtpeVdIcDg+f1nxcVZwHiI1R50n9Q4p7MnF
LoUH+V+Lc77q/3OqHaxZfJ9MAqh68G6hPu8G4e5e9U4Wsa3yEwdDX4rgobL9oJF/
cdxdwWGt8/A+DcGjKUD/nJX47lXXrmFOF9xxpWCMLwXRxPHCxAn6MbVFHmxqCXAY
kLQJU7jgrWKyO7spBrk+3H5AJCy05/Pgf0w3A7cENLUSS6YD+YxWC0009y2U1MbZ
getUyFuCUFkQaJlHL58H7uxk0gvSyRgY5bsvP+Edh1yF7EoDN7hXA7k3vl7qdSm1
t5ekd5GkFGecBeMN4bt2V09AG89W11FCWR6EG61Nek0W9rRFhRu4PfRl6P33FAVN
grA5xr1MoFk5H84codX6MlKkMuHOnOWjQp/lpJrKRWsf5TCiBqAkQUzq+HaQQtk9
Fbo/12BrRaGU6Dgl/0rRkzCTKEwZL+5w6H2xbV86kmHsT2HV00t0rdIPnygw4gGC
mO37yOINv8g1/N5xBcAFG1Ypx3WfP8pbgqYzYHT4sKFN9AqM6wrwEQ46VZ1UCdzT
wQu1MyX0gEoER+ZUM7IH/plonZepY73qoCOUpRIqgcna9KLEIafnvqG6Z9WskElm
OivOANRA6SmaoUYUEmdH/RrescdFmCmDOT1V9D3NB1pmZI8BLAw=
=w6JH
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to