numpy version 1.17 has replaced the internal fftpack module with pocketfft (see release notes here: https://github.com/numpy/numpy/blob/master/doc/release/1.17.0-notes.rst)
This causes an exception to be raised in the following line of code:
which has the effect of breaking the remove_response() method of the Trace object, as demonstrated in the test script I've attached (renamed to .txt to make github happy).
The error is:
AttributeError: module 'numpy.fft' has no attribute 'fftpack'
OS Version: OSX 10.13.6
Python: 3.6.7
numpy: 1.17.0
obspy: 1.1.1
I created a test environment with conda:
conda create -n testfft python=3.6 obspy
The workaround, I suppose is to not use numpy 1.17 or higher until this is patched in obspy.
It is surprising to me that numpy removed fftpack without a deprecation cycle. It will certainly break mores codes than just obspy.
@mhearne-usgs conda-forge repository is updated, so this should not hit people anymore installing new environments or updating theirs.. at least when obspy 1.1.1 is selected, i.e. when people don't force numpy >= 1.17 or some other dependencies to high version that pull in numpy 1.17, conda will pull older obspy packages unfortunately, nothing we can do.
Thanks for reporting this, this should help minimize people getting affected by a lot.
Is the fix for this as simple as wrapping the limit_numpy_fft_cache() in a version check?
if np.__version__ < '1.17.0':
limit_numpy_fft_cache()
Or is there a reason this would be a bit of a hacked solution? I didn't see an equivalent to fft_cache_() in pocketfft.
Can't say @aringler-usgs, didn't have time to look into it yet..
Yes.
I actually contributed this fix to numpy a while ago so it should not be necessary anymore. But now with fftpack gone it is fully obsolete.
Am 6. Aug. 2019, 19:15, um 19:15, aringler-usgs notifications@github.com schrieb:
Is the fix for this as simple as wrapping the
limit_numpy_fft_cache()
in a version check?if np.__version__ < '1.17.0': limit_numpy_fft_cache()Or is there a reason this would be a bit of a hacked solution? I
didn't see an equivalent tofft_cache_()in pocketfft.--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/obspy/obspy/issues/2434#issuecomment-518739630
So I guess the answer would be yes @aringler-usgs, I think that's what we should do.