update to numpy-1.5.0 gives new warnings from scipy

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

update to numpy-1.5.0 gives new warnings from scipy

Neal Becker
After update to numpy-1.5.0, I'm getting warnings from scipy.
These probably come from my code using convolve.  Does scipy need updating?

/home/nbecker/.local/lib/python3.6/site-packages/scipy/fftpack/basic.py:160: 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.
  z[index] = x
/home/nbecker/.local/lib/python3.6/site-packages/scipy/signal/signaltools.py:491: 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.
  return x[reverse].conj()
/home/nbecker/.local/lib/python3.6/site-packages/scipy/signal/signaltools.py:251: 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.
  in1zpadded[sc] = in1.copy()

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: update to numpy-1.5.0 gives new warnings from scipy

Sebastian Berg
On Wed, 2018-07-25 at 07:44 -0400, Neal Becker wrote:
> After update to numpy-1.5.0, I'm getting warnings from scipy.
> These probably come from my code using convolve.  Does scipy need
> updating?
>

Probably yes, I am a bit surprised we did not notice it before if it is
in scipy (or maybe scipy is already fixed?). This may be one of the
more controversial new warnings, so lets see if it comes up more. Right
now it seems not to affect much, I guess.
If the correct thing to do is to use the list as an array, then the
easiest solution maybe to do:

z[index,] = x  # note the additional `,`
# or alternatively of course: z[np.asarray(index)] = x

Otherwise, you will have to use `tuple(index)` to make sure numpy
interprets it as a multi-dimensional index.

The problem here, that this solves, is that if you have `z[some_list]`
currently numpy basically guesses whether you want a multi-dimensional
index or not.

- Sebastian


> /home/nbecker/.local/lib/python3.6/site-
> packages/scipy/fftpack/basic.py:160: 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.
>   z[index] = x
> /home/nbecker/.local/lib/python3.6/site-
> packages/scipy/signal/signaltools.py:491: 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.
>   return x[reverse].conj()
> /home/nbecker/.local/lib/python3.6/site-
> packages/scipy/signal/signaltools.py:251: 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.
>   in1zpadded[sc] = in1.copy()
> _______________________________________________
> NumPy-Discussion mailing list
> [hidden email]
> https://mail.python.org/mailman/listinfo/numpy-discussion
_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: update to numpy-1.5.0 gives new warnings from scipy

ralfgommers
In reply to this post by Neal Becker


On Wed, Jul 25, 2018 at 11:44 AM, Neal Becker <[hidden email]> wrote:
After update to numpy-1.5.0, I'm getting warnings from scipy.
These probably come from my code using convolve.  Does scipy need updating?

Should already be fixed in scipy master.

Cheers,
Ralf



/home/nbecker/.local/lib/python3.6/site-packages/scipy/fftpack/basic.py:160: 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.
  z[index] = x
/home/nbecker/.local/lib/python3.6/site-packages/scipy/signal/signaltools.py:491: 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.
  return x[reverse].conj()
/home/nbecker/.local/lib/python3.6/site-packages/scipy/signal/signaltools.py:251: 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.
  in1zpadded[sc] = in1.copy()

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion



_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion