Skip to content

Commit 33a4930

Browse files
committed
FIX: Call resample from scipy.signal namespace
1 parent 62d15df commit 33a4930

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

nitime/algorithms/tests/test_coherence.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import numpy as np
1010
import numpy.testing as npt
11-
from scipy.signal import signaltools
11+
from scipy import signal
1212
import pytest
1313

1414
import matplotlib
@@ -239,7 +239,7 @@ def test_coherence_linear_dependence():
239239
"Fs": 2 * np.pi}
240240

241241
f, c = tsa.coherence(np.vstack([x, y]), csd_method=method)
242-
c_t = np.abs(signaltools.resample(c_t, c.shape[-1]))
242+
c_t = np.abs(signal.resample(c_t, c.shape[-1]))
243243

244244
npt.assert_array_almost_equal(c[0, 1], c_t, 2)
245245

nitime/tests/test_algorithms.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import numpy as np
44
import numpy.testing as npt
55

6-
from scipy.signal import signaltools
7-
from scipy import fftpack
6+
from scipy import fftpack, signal
87

98
import nitime
109
from nitime import algorithms as tsa
@@ -24,16 +23,16 @@ def test_scipy_resample():
2423
for f in freq_list]
2524
tst = np.array(a).sum(axis=0)
2625
# interpolate to 128 Hz sampling
27-
t_up = signaltools.resample(tst, 128)
26+
t_up = signal.resample(tst, 128)
2827
np.testing.assert_array_almost_equal(t_up[::2], tst)
2928
# downsample to 32 Hz
30-
t_dn = signaltools.resample(tst, 32)
29+
t_dn = signal.resample(tst, 32)
3130
np.testing.assert_array_almost_equal(t_dn, tst[::2])
3231

3332
# downsample to 48 Hz, and compute the sampling analytically for comparison
3433
dn_samp_ana = np.array([np.sin(2 * np.pi * f * np.linspace(0, 1, 48, endpoint=False))
3534
for f in freq_list]).sum(axis=0)
36-
t_dn2 = signaltools.resample(tst, 48)
35+
t_dn2 = signal.resample(tst, 48)
3736
npt.assert_array_almost_equal(t_dn2, dn_samp_ana)
3837

3938

0 commit comments

Comments
 (0)