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

splitting NuFFT into base and uu,vv cached class. #232

Merged
merged 13 commits into from
Dec 13, 2023
Merged

Conversation

iancze
Copy link
Collaborator

@iancze iancze commented Dec 9, 2023

closes #231 when complete.

  • this changes the old fourier.NuFFT -> new fourier.NuFFTCached. The __init__ call of fourier.NuFFTCached is the same as the old fourier.NuFFT. You would use it like nufft = fourier.NuFFTCached(coords=coords, nchan=1, uu=uu, vv=vv)
  • creates a new fourier.NuFFT that does not require uu or vv on init. You would init it like nufft = fourier.NuFFT(coords=coords, nchan=1). The difference comes when using the forward routine, in that you now supply u and v points. E.g., nufft(image_cube(), uu, vv)
  • The idea is that the new fourier.NuFFT should be the go-to routine for most use cases. The fourier.NuFFTCached should be used when one expects to make multiple calls to forward using the exact same set of uu and vv points (but different input images).

@iancze iancze requested a review from jeffjennings December 9, 2023 23:24
Copy link
Contributor

@jeffjennings jeffjennings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It looks like the pyro tutorial has an outdated called to the nufft.

  • The naming for nufftcached and nufft makes sense, but I would suggest not reusing the name of an old class for a new class with a different functionality and/or call signature. Yes the code is pre-1.0 and you want the new nufft to be the default, but this breaks backwards compatability and will probably be frustrating for some users. Instead, the cached implementation could still be NuFFT and the new could be NuFFTdynamic or something. If the new names are kept as is, I'd suggest the changelog note that the NuFFT is not backwards compatible as of the next release version.

@iancze
Copy link
Collaborator Author

iancze commented Dec 10, 2023

Thanks for the review!

  • It looks like the pyro tutorial has an outdated called to the nufft.

Ah, right. This is in the "large-tutorials" whose cache is not cleared with a make clean, so I missed it.

  • The naming for nufftcached and nufft makes sense, but I would suggest not reusing the name of an old class for a new class with a different functionality and/or call signature. Yes the code is pre-1.0 and you want the new nufft to be the default, but this breaks backwards compatability and will probably be frustrating for some users. Instead, the cached implementation could still be NuFFT and the new could be NuFFTdynamic or something. If the new names are kept as is, I'd suggest the changelog note that the NuFFT is not backwards compatible as of the next release version.

I agree the change of names is unfortunate, but I think the original implementation and naming was enough of a mistake that it should be corrected (especially since we are pre-1.0, the user base is small, and we should take these opportunities for re-organization/consolidation). The new NuFFT should be the preferred behavior in most cases (and more closely matches the original TorchKbNuFFT pattern), whereas the caching behavior is much more specialized. Honestly, for ALMA-sized datasets, I'm not even sure if there will be many cases where NuFFT cached will be used. It's prohibitively slow as the number of visibility points grows, so predicting full datasets will be necessary using the behaviour of the new NuFFT. I'll make an entry in the changelog about the switch.

@iancze iancze added the bug Something isn't working label Dec 13, 2023
@iancze iancze removed the bug Something isn't working label Dec 13, 2023
@iancze iancze merged commit cb28c37 into main Dec 13, 2023
4 checks passed
@iancze iancze deleted the nufft_bifurcate branch December 13, 2023 13:20
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 this pull request may close these issues.

fourier.NuFFT needs a .forward routine that can take in new uu, vv points.
2 participants