-
Notifications
You must be signed in to change notification settings - Fork 34
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
Put tests of FFT backends into TestUtils submodule #78
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #78 +/- ##
==========================================
- Coverage 92.04% 87.20% -4.84%
==========================================
Files 3 4 +1
Lines 289 336 +47
==========================================
+ Hits 266 293 +27
- Misses 23 43 +20
☔ View full report in Codecov by Sentry. |
I think a test of the interface does not require AD tests (#76 (comment))? I assumed one would only want to check whatever is required by the interface, i.e., basically what's written and required in the documentation of the interface. |
That's a fair point. I had no special reason to depend on
|
388ba18
to
780f206
Compare
This is ready for a review! |
Bump (looking for a review on this before the chain rules PRs; I'll adapt those after this has been merged) |
@devmotion this is ready for another review. One important point: it seems to be controversial to introduce a |
@devmotion bump since this is blocking the plan chainrules work (please also see my comment above about a potential |
Yeah, I was thinking about that. Given that generally the ecosystem tries to keep dependencies minimal, I agree that it's maybe not completely optimal to include and precompile them even if users don't need them. On the other hand, I don't think the PR in TranscodingStreams is the best approach either: If the test interface is available only in a I think there are a few alternatives:
Maybe there are more options? Maybe even an extension on Julia >= 1.9, but I'm not sure if/how that works with stdlibs? I guess given the current situation, maybe a subpackage would be a good option? What do you think? |
I think a subpackage is a better solution than including the files. I've made the move, but I'm currently working on updating the CI so that the |
679fe7a
to
b016d54
Compare
@devmotion I've made the subpackage, but I'm just not able to understand the error on Julia nightly. It's easily reproducible on 1.9 by trying to develop the |
There's also a "Circular dependency detected" warning for seemingly no reason on Julia 1.8: |
Hmm, I came to realize that it won't work this way even if tests would pass on Github since it means you would have to add AbstractFFTsTestUtils manually every time you want to run the tests locally. I see at least two options: We could move the tests with the test utilities to the subpackage and test the subpackage additionally (or only, if no tests are left in AbstractFFTs - but I don't think all tests exercise the FFT interface?); Or alternatively we could add the local version of AbstractFFTsTestUtils in the subfolder in test/runtests.jl. Generally I'm not a fan of messing around with packages in Julia scripts since this can lead to inconsistent states: If you already have an older/newer version loaded of some package, you have to restart the Julia process since otherwise the desired version is not used. And I've experienced such problems in multiple other projects. I guess here it could work though since AbstractFFTsTestUtils only depends on AbstractFFTs and Test, so no other packages should be affected. |
I've implemented the develop-from-test-script solution here |
@devmotion tests should be sorted now |
src/TestUtils.jl
Outdated
""" | ||
function test_plan_adjoint end | ||
|
||
function __init__() |
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.
You can wrap it inside a if isdefined(Base, :get_extension)
.
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.
Outside of the whole __init__
function I meant, not in its function body.
cacf69e
to
3dde8dc
Compare
3dde8dc
to
3537f76
Compare
Comments addressed, and I also refactored some repeated logic in the test utilities 🙂 |
Bump on review |
Couldn't we do a multi-repo like Makie.jl, where this repo contains both the AbstractFFTs package and an AbstractFFTTests package? (In the long run, a better way to do testing is described at https://dsp.stackexchange.com/questions/633/what-data-should-i-use-to-test-an-fft-implementation-and-what-accuracy-should-i and is used in FFTW: it is sufficient to test linearity for random inputs, the unit-impulse response, and the time-shift property for random inputs.) |
src/TestUtils.jl
Outdated
""" | ||
function test_plan_adjoint end | ||
|
||
function __init__() |
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.
Outside of the whole __init__
function I meant, not in its function body.
Co-authored-by: David Widmann <[email protected]>
@gaurav-arya |
@vpuri3 confused me at first too, but that is how to migrate from a hard dep to a weak extension on 1.9+: https://pkgdocs.julialang.org/v1.9/creating-packages/#Transition-from-normal-dependency-to-extension |
does this PR need anything more to merge? Please note that I have locally tested JuliaMath/FFTW.jl#249 with #78 and #109, so FFTW rules are ready to go. See also the tracking issue: #94 Regarding uncertaintities about weak extensions v.s. separate packages, etc: I have described the |
Merge conflicts resolved :) |
LGTM. |
Could this get a release, to help with CI on downstream PRs? |
Puts tests that also stress test a particular FFT backend into a submodule
TestUtils
whose functionality can be used downstream.