-
Notifications
You must be signed in to change notification settings - Fork 9
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
Tests for consistency of HEALPix FFT and IFFT implementations #170
Conversation
@CosmoMatt has confirmed assumptions (3) and (4) above will not necessarily hold:
so removed the corresponding tests. |
@matt-graham thanks for setting this up. I've added a fix, basically the way the test was written you are comparing the consistency between two functions applied to an input vector. However, when the first (numpy baseline) function is applied it appears to update the input vector, so the second function is being applied to a different vector, hence producing different results. I've added a "fix" to the test which explicitly copies the input vector to avoid this failure mode. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #170 +/- ##
=======================================
Coverage 91.63% 91.63%
=======================================
Files 22 22
Lines 2510 2510
=======================================
Hits 2300 2300
Misses 210 210 ☔ View full report in Codecov by Sentry. |
Should we add some tests here that check that the |
I think this should be fine as is @matt-graham. The arrays that are mutated are generated internally to the overall harmonic transform and it's unlikely that any user will run individual components of the overall transform independently (such as the FFT step) |
Adds some tests for consistency between the NumPy and JAX implementations of HEALPix fast Fourier transform (FFT) and inverse FFT functions in
s2fft.utils.healpix_ffts
.Assumes that
healpix_fft_numpy
andhealpix_fft_jax
should give consistent outputs (up to floating point error) for equivalent input argumentshealpix_ifft_numpy
andhealpix_ifft_jax
should give consistent outputs (up to floating point error) for equivalent input arguments,healpix_fft_numpy
andhealpix_ifft_numpy
as partial functions only on first arguments are inverses of each other,healpix_fft_jax
andhealpix_ifft_jax
as partial functions only on first arguments are inverses of each other.I'm not sure that 3 and 4 are necessarily true or not.
At the moment only the tests for 1 all pass with tests for 2, 3 and 4 failing. This may well be due to the assumptions above being invalid.