diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 7f2ba08..94ef4cb 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -15,7 +15,7 @@ source: build: skip: true # [win and py==38] - number: 0 + number: 1 requirements: @@ -27,19 +27,20 @@ requirements: - future - numpy - fftw + - pyfftw ==0.12 - llvm-openmp >=4.0.1 # [osx] run: - python - setuptools - future - {{ pin_compatible('numpy') }} + - pyfftw ==0.12 - fftw - - scipy >=0.18, <1.9.0 + - scipy <1.9.0 - matplotlib-base - obspy - bottleneck - pyproj - - pyfftw - h5py - llvm-openmp >=4.0.1 # [osx] diff --git a/recipe/run_test.py b/recipe/run_test.py index 5961f1e..c26076a 100644 --- a/recipe/run_test.py +++ b/recipe/run_test.py @@ -107,6 +107,27 @@ def check_c_locations(): # Load the cdll cdll = libnames._load_cdll("libutils") + +def test_pyfftw_resample(): + """ Check that pyfftw works properly with our fftw libs. """ + import io + from contextlib import redirect_stdout + from eqcorrscan.utils.pre_processing import _resample + + tr = Trace(np.random.randn(360000)) + tr.stats.sampling_rate = 100.0 + + f = io.StringIO() + with redirect_stdout(f): + # If linking not done properly then this will output a traceback to stdout + tr_resampled = _resample(tr, 50, threads=2) + assert f.getvalue() == '' + +def test_obspy_resample(): + """ Check that obspy resample works - scipy hanning to hann name change. """ + tr = Trace(np.random.randn(360000)) + tr.resample(50) + if __name__ == '__main__': """ @@ -114,3 +135,5 @@ def check_c_locations(): """ check_c_locations() test_multi_channel_xcorr() + test_pyfftw_resample() + test_obspy_resample()