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

Accommodate AbstractFFTs.jl#26 fftfreq etc. #300

Closed
wants to merge 3 commits into from

Conversation

carstenbauer
Copy link
Contributor

@carstenbauer carstenbauer commented May 15, 2019

This PR accommodates JuliaMath/AbstractFFTs.jl#26.

The definitions for fftfreq, rfftfreq, as well as the Frequencies type has been moved to AbstractFFTs.jl. Hence these definitions aren't necessary in DSP.jl anymore.

All tests pass locally. They will fail here, since JuliaMath/AbstractFFTs.jl#26 hasn't been merged yet.

Do not merge before JuliaMath/AbstractFFTs.jl#26 has been merged!

@galenlynch
Copy link
Member

Could you also:

  1. Add a deprecation for these functions, pointing users to AbstractFFTs
  2. Remove tests in test/util.jl
  3. Remove the documentation fromdocs/src/util.jl

@ssfrr
Copy link
Contributor

ssfrr commented May 16, 2019

Agreed there should be deprecation warnings here, though I don't think they should guide the user to use AbstractFFTs. As far as I understand the FFT usage, users shouldn't generally import AbstractFFTs directly. Most folks should import FFTW, which re-exports all functions exported from AbstractFFTs. CuArrays is another provider of FFT implementations, which doesn't currently use @reexport to re-export all the symbols but I think it should.

I guess people writing generic code that takes in arrays of unknown types would use AbstractFFTs and then rely on the user to have the correct implementations loaded for whatever arrays they're using?

Perhaps @ararslan or @stevengj can clarify what the expectation is for how the FFT packages are supposed to be used?

@ararslan
Copy link
Member

From the AbstractFFTs README:

This package is mainly not intended to be used directly.

So I agree that deprecations shouldn't point directly to AbstractFFTs.

@carstenbauer
Copy link
Contributor Author

@galenlynch I implemented you suggestions. Regarding the deprecation I just @deprecated functions to equivalents reexported by FFTW for now.

src/util.jl Outdated Show resolved Hide resolved
@galenlynch
Copy link
Member

@crstnbr could you please implement @martinholters suggestions so we can merge this once a new tagged version on AbstractFFTs.jl is available?

@carstenbauer
Copy link
Contributor Author

@galenlynch I'm currently on vacation. Will try to get back to this next week!

@carstenbauer
Copy link
Contributor Author

Alright, tests pass locally (with AbstractFFTs#master and FFTW#master).

@carstenbauer
Copy link
Contributor Author

carstenbauer commented Nov 9, 2019

@ararslan
Copy link
Member

ararslan commented Nov 9, 2019

This should set AbstractFFTs = "0.5" in the Project.toml [compat] section.

@carstenbauer
Copy link
Contributor Author

This should set AbstractFFTs = "0.5" in the Project.toml [compat] section.

Why? DSP doesnt have AbstractFFTs as a direct dependency. So this shouldn't be necessary, right? Instead I believe we should set the FFTW compat, which I do in #321.

@ararslan
Copy link
Member

ararslan commented Nov 9, 2019

We just need to make sure that DSP can't get AbstractFFTs < 0.5.

@ararslan
Copy link
Member

ararslan commented Nov 9, 2019

Something like JuliaMath/FFTW.jl#124 will be necessary, I think. (cf #321 (comment))

@@ -6,6 +6,7 @@ using ..Util, ..Windows
export arraysplit, nextfastfft, periodogram, welch_pgram, mt_pgram,
spectrogram, power, freq, stft
using FFTW
import FFTW: Frequencies, fftfreq, rfftfreq
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
import FFTW: Frequencies, fftfreq, rfftfreq

I believe this isn't necessary, since there's a using FFTW and FFTW reexports the symbols from AbstractFFTs. Same with the import from DSP in the tests.

@ararslan
Copy link
Member

I put this and #321 together with an adjustment to the FFTW bound and a version bump in #322 with Carsten's authorship preserved. Thanks so much for your work on this, @crstnbr!

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.

5 participants