Skip to content

Commit 04d41d9

Browse files
committed
FIX: Drop deprecated numpy aliases to builtin types
1 parent c8a03ee commit 04d41d9

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

nitime/algorithms/cohere.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ def cache_fft(time_series, ij, lb=0, ub=None,
10051005
FFT_conj_slices = {}
10061006

10071007
for i_channel in all_channels:
1008-
Slices = np.zeros((n_slices, n_freqs), dtype=np.complex)
1008+
Slices = np.zeros((n_slices, n_freqs), dtype=complex)
10091009
for iSlice in range(n_slices):
10101010
thisSlice = time_series[i_channel,
10111011
i_times[iSlice]:i_times[iSlice] + NFFT]
@@ -1161,7 +1161,7 @@ def cache_to_relative_phase(cache, ij):
11611161
channels_i = max(1, max(ij_array[:, 0]) + 1)
11621162
channels_j = max(1, max(ij_array[:, 1]) + 1)
11631163
# Pre-allocate for speed:
1164-
Phi_xy = np.zeros((channels_i, channels_j, freqs), dtype=np.complex)
1164+
Phi_xy = np.zeros((channels_i, channels_j, freqs), dtype=complex)
11651165

11661166
# These checks take time, so do them up front, not in every iteration:
11671167
if list(FFT_slices.items())[0][1].shape[0] > 1:
@@ -1221,7 +1221,7 @@ def cache_to_coherency(cache, ij):
12211221

12221222
channels_i = max(1, max(ij_array[:, 0]) + 1)
12231223
channels_j = max(1, max(ij_array[:, 1]) + 1)
1224-
Cxy = np.zeros((channels_i, channels_j, freqs), dtype=np.complex)
1224+
Cxy = np.zeros((channels_i, channels_j, freqs), dtype=complex)
12251225

12261226
#These checks take time, so do them up front, not in every iteration:
12271227
if list(FFT_slices.items())[0][1].shape[0] > 1:

nitime/analysis/coherence.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,10 +653,10 @@ def coherency(self):
653653
if len(self.seed.shape) > 1:
654654
Cxy = np.empty((self.seed.data.shape[0],
655655
self.target.data.shape[0],
656-
self.frequencies.shape[0]), dtype=np.complex)
656+
self.frequencies.shape[0]), dtype=complex)
657657
else:
658658
Cxy = np.empty((self.target.data.shape[0],
659-
self.frequencies.shape[0]), dtype=np.complex)
659+
self.frequencies.shape[0]), dtype=complex)
660660

661661
#Get the fft window cache for the target time-series:
662662
cache = self.target_cache

nitime/analysis/correlation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def corrcoef(self):
147147

148148
# Preallocate results
149149
Cxy = np.empty((self.seed.data.shape[0],
150-
self.target.data.shape[0]), dtype=np.float)
150+
self.target.data.shape[0]), dtype=float)
151151

152152
for seed_idx, this_seed in enumerate(self.seed.data):
153153

nitime/tests/test_algorithms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def test_psd_matlab():
145145
ts = np.loadtxt(os.path.join(test_dir_path, 'tseries12.txt'))
146146

147147
#Complex signal!
148-
ts0 = ts[1] + ts[0] * np.complex(0, 1)
148+
ts0 = ts[1] + ts[0] * complex(0, 1)
149149

150150
NFFT = 256
151151
Fs = 1.0

0 commit comments

Comments
 (0)