diffpy / diffpy.fourigui

Other
0 stars 7 forks source link

Fixed warning in fourigui.py code #56

Closed Fil158 closed 3 weeks ago

Fil158 commented 3 weeks ago

Closes #22 Warning fixed in fourigui.py adding line 397 axes = list(range(len(size))) and modifying line 399 fftholder = np.fft.fftn(fftholder, s=size, axes=axes, norm="ortho")

bobleesj commented 3 weeks ago

@Fil158 The original issue mentioned here was created to ensure we re-visit to fix these warnings. But, what exact warnings are you fixing and how? Even if it's a simple fix, we will probably forget things later and also it will be useful for future maintainers.

bobleesj commented 3 weeks ago

Warning fixed in fourigui.py adding line 397 axes = list(range(len(size))) and modifying line 399 fftholder = np.fft.fftn(fftholder, s=size, axes=axes, norm="ortho")

Thanks for this. Reviewers all can see what were changed. This information has no further value...

cadenmyers13 commented 3 weeks ago

@sbillinge @Fil158 fftholder is (101, 101, 101) and there are three axes, (0, 1, 2). Fourigui allows you to explore reciprocal space in 3D. The user specifies an axis (0,1, or 2) then the slider in the gui (which goes from 0 to 100 in the test case) allows you to look at a specific slice, hence the shape (101, 101, 101). This seems to me to be on the right track. Here's an image of the gui

Screenshot 2024-11-07 at 4 34 58 PM
cadenmyers13 commented 3 weeks ago

I don't know if my inline comments are showing to everyone... so I'm pasting them here. Sorry if you see duplicates.

@sbillinge Here's some info from the np.fft.fftn() documentation. If we specify s we must specify axes in numpy2. To make it more readable, maybe we can change it to axes = list(range(fftholder.ndim))?

Screenshot 2024-11-07 at 11 55 35 AM
bobleesj commented 3 weeks ago

@cadenmyers13 as we discussed, could you utilize the knowledge here to resolve the warnings in a new PR?

bobleesj commented 3 weeks ago

@Fil158 you may close this issue if @cadenmyers13 is willing to do so.