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

Pin scipy and pyfftw for EQcorrscan 0.4.4 #43

Merged
merged 9 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()