Skip to content

Commit

Permalink
Merge pull request #43 from eqcorrscan/master
Browse files Browse the repository at this point in the history
Pin scipy and pyfftw for EQcorrscan 0.4.4
  • Loading branch information
calum-chamberlain authored Aug 11, 2022
2 parents f2af84e + 4e37eda commit add31f6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
7 changes: 4 additions & 3 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ source:

build:
skip: true # [win and py==38]
number: 0
number: 1


requirements:
Expand All @@ -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]

Expand Down
23 changes: 23 additions & 0 deletions recipe/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,33 @@ 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__':
"""
Run core tests
"""
check_c_locations()
test_multi_channel_xcorr()
test_pyfftw_resample()
test_obspy_resample()

0 comments on commit add31f6

Please sign in to comment.