Package: python3-mpltoolkits.basemap Version: 1.0.7+dfsg-4 Severity: normal Tags: patch
Dear Maintainer, When using the "contourf" function, some map-projections (e.g. 'mill') fail with the following error condition: IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices This is triggered near line 3644 of /usr/lib/python3/dist-packages/mpl_toolkits/basemap/__init__.py, where there is a floating-point divide '/' in computing x.shape[0]/2, rather than a rounding divide '//'. Since upgrading from 'jessie' to 'stretch', there appear to have been changes somewhere in the python3/numpy/matplotlib/basemap stack which mean that this division is now returning a floating-point number, which is not valid for indexing numpy arrays. The attached (minuscule) patch (replacing '/' with '//') seems to fix the problem. Kind regards, RW Penney -- System Information: Debian Release: 9.0 APT prefers stable APT policy: (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 4.9.0-3-amd64 (SMP w/4 CPU cores) Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8), LANGUAGE=en_GB:en (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages python3-mpltoolkits.basemap depends on: ii libc6 2.24-11+deb9u1 ii libgeos-c1v5 3.5.1-3 ii python-mpltoolkits.basemap-data 1.0.7+dfsg-4 ii python3 3.5.3-1 ii python3-matplotlib 2.0.0+dfsg1-2 python3-mpltoolkits.basemap recommends no packages. Versions of packages python3-mpltoolkits.basemap suggests: ii python3-scipy 0.18.1-2 -- no debconf information
--- python3/dist-packages/mpl_toolkits/basemap/__init__-orig.py 2017-07-21 05:45:55.215475663 +0100 +++ python3/dist-packages/mpl_toolkits/basemap/__init__.py 2017-07-21 05:46:07.355478959 +0100 @@ -3641,7 +3641,7 @@ # with the shiftgrid function. # only do this check for global projections. if self.projection in _cylproj + _pseudocyl: - xx = x[x.shape[0]/2,:] + xx = x[x.shape[0]//2,:] condition = (xx >= self.xmin) & (xx <= self.xmax) xl = xx.compress(condition).tolist() xs = xl[:]