Skip to content

Commit 62d15df

Browse files
committed
TEST: Use 1j literal instead of deprecated scipy.sqrt() on -1
1 parent 2b42b43 commit 62d15df

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

nitime/algorithms/tests/test_spectral.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ def test_get_spectra_complex():
7070
r, _, _ = utils.ar_generator(N=2 ** 16) # It needs to be that long for
7171
# the answers to converge
7272
c, _, _ = utils.ar_generator(N=2 ** 16)
73-
arsig1 = r + c * scipy.sqrt(-1)
73+
arsig1 = r + c * 1j
7474

7575
r, _, _ = utils.ar_generator(N=2 ** 16)
7676
c, _, _ = utils.ar_generator(N=2 ** 16)
7777

78-
arsig2 = r + c * scipy.sqrt(-1)
78+
arsig2 = r + c * 1j
7979
avg_pwr1.append((arsig1 * arsig1.conjugate()).mean())
8080
avg_pwr2.append((arsig2 * arsig2.conjugate()).mean())
8181

@@ -118,7 +118,7 @@ def test_periodogram():
118118
N = 1024
119119
r, _, _ = utils.ar_generator(N=N)
120120
c, _, _ = utils.ar_generator(N=N)
121-
arsig = r + c * scipy.sqrt(-1)
121+
arsig = r + c * 1j
122122

123123
f, c = tsa.periodogram(arsig)
124124
npt.assert_equal(f.shape[0], N) # Should be N, not the one-sided N/2 + 1
@@ -143,11 +143,11 @@ def test_periodogram_csd():
143143
N = 1024
144144
r, _, _ = utils.ar_generator(N=N)
145145
c, _, _ = utils.ar_generator(N=N)
146-
arsig1 = r + c * scipy.sqrt(-1)
146+
arsig1 = r + c * 1j
147147

148148
r, _, _ = utils.ar_generator(N=N)
149149
c, _, _ = utils.ar_generator(N=N)
150-
arsig2 = r + c * scipy.sqrt(-1)
150+
arsig2 = r + c * 1j
151151

152152
tseries = np.vstack([arsig1, arsig2])
153153

0 commit comments

Comments
 (0)