Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning in wavelet.py #263

Closed
milancurcic opened this issue Sep 14, 2023 · 2 comments · Fixed by #340
Closed

DeprecationWarning in wavelet.py #263

milancurcic opened this issue Sep 14, 2023 · 2 comments · Fixed by #340

Comments

@milancurcic
Copy link
Member

../home/milan/Work/clouddrift/clouddrift/clouddrift/wavelet.py:673: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  radian_frequency = high_ * np.ones(int(m + 1)) / r ** np.arange(0, m + 1)

I don't recall getting this during testing of the wavelet PR but I'm getting it now. I may be on a more recent NumPy version here.

@selipot
Copy link
Member

selipot commented Sep 14, 2023

I have not seen this one. Do you know what the issue is exactly? the int(m+1) and/or np.arange(0,m+1)?

@milancurcic
Copy link
Member Author

I suspect that m here is a single-element array:

In [42]: np.arange(0, np.arange(1))
<ipython-input-42-be4769809432>:1: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  np.arange(0, np.arange(1))
Out[42]: array([], dtype=int64)

should be an easy fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants