convolve.py: use `arr[tuple(seq)]` instead of `arr[seq]` -- with numpy 1.14.0
See original GitHub issueHi. I get such warnings when using numpy 1.14.0:
/home/nima/.local/lib/python3.5/site-packages/astropy/convolution/convolve.py:692: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
bigimwt[arrayslices] = 1.0 - nanmaskarray * interpolate_nan
/home/nima/.local/lib/python3.5/site-packages/astropy/convolution/convolve.py:700: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
bigimwt[arrayslices] = wtsm.real[arrayslices]
/home/nima/.local/lib/python3.5/site-packages/astropy/convolution/convolve.py:735: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
result = rifft[arrayslices].real
Rolling back to numpy 1.10 seems to solve the problem.
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
numpy.convolve — NumPy v1.24 Manual
Convolve two arrays using the Fast Fourier Transform. ... Note how the convolution operator flips the second array before “sliding” the two across...
Read more >scipy.signal.convolve — SciPy v1.9.3 Manual
An N-dimensional array containing a subset of the discrete linear convolution of in1 with in2. Warns. RuntimeWarning. Use of the FFT convolution on...
Read more >Using np.view() with changes to structured arrays in numpy 1.14
In [165]: some_data = np.array([('foo', 3.5, 2.15), ('bar', 2.8, 5.3), ('baz', 1.2, 3.7)], dtype=[('col1', '<U20'), ('A', '<f8'), ('B', ...
Read more >numpy 1.14.0 - PyPI
NumPy is a general-purpose array-processing package designed to efficiently manipulate large multi-dimensional arrays of arbitrary records without ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is a recent change in numpy, with the intent to make indexing with a list always return the items in that list, i.e., that only with a tuple you get indexes for each axis. One can add
tuple(arrayslices)
or perhaps ensurearrayslices
is a tuple in the first place.Maybe a topic for the coordination meeting - under what conditions do we envisage ever breaking backward compatibility in future? The reason Python 3 was bad is because they packaged all the breaks in a single release. In a way, Numpy’s approach is less impactful - just break one thing per release 😉