-
Notifications
You must be signed in to change notification settings - Fork 7
Fixed warning in fourigui.py code #56
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| **Added:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Changed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Deprecated:** | ||
|
|
||
| * Deprecation warning fixed for axes in np.fft in fourigui.py | ||
|
|
||
| **Removed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Fixed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Security:** | ||
|
|
||
| * <news item> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -394,8 +394,9 @@ def fft(self): | |
| def perform_fft(fftholder): | ||
| fftholder = np.nan_to_num(fftholder) | ||
| size = list(fftholder.shape) | ||
| axes = list(range(len(size))) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not very clear. In the comments, let's have a brief discussion of what is deprecated in numpy2 and how we are fixing it. Not too much, but presumably @Fil158 you googled something and found something out so it is helpful to share what you found out and a few words about how it affects us here and so your suggested fix. It builds more confidence that we understand what we are doing. Also, please make your PR title more informative. Which warning does this PR fix? Not too long, but just enough. I am not sure but there is almost certainly a more readable fix than
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sbillinge Here is the worning, please see the Numpy official documentation To solve it I specify axes which is a list of integers with the same size of s After the changes pytests run correctly and fourigui app works with test data.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @Fil158 this is very helpful. Next we need a quick discussion about what the shape of the arrays are and what th axes are and what our desired fft is. Then finally, what code we think is best to accomplish that. |
||
| fftholder = np.fft.ifftshift(fftholder) | ||
| fftholder = np.fft.fftn(fftholder, s=size, norm="ortho") | ||
| fftholder = np.fft.fftn(fftholder, s=size, axes=axes, norm="ortho") | ||
| fftholder = np.fft.fftshift(fftholder) | ||
| fftholder = fftholder.real | ||
| return fftholder | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fil158
Typically depreciated refers to classes and functions no longer supported.
Here, we are fixing these annoying warnings. So you can put it under "Fixed" - please refer to the "Lessons from ..." GitLab guide for writing a news file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, next time I'll do so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No please do now. These are user facing news.