Skip to content

Commit 3437e20

Browse files
committed
np.float64 for npy.float
1 parent 526f697 commit 3437e20

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+136
-136
lines changed

examples/ds105/ds105_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,13 @@ def run_model(subj, run):
243243
tempdict = {}
244244
for v in ['sd', 't', 'effect']:
245245
tempdict[v] = np.memmap(NamedTemporaryFile(prefix='%s%s.nii'
246-
% (n,v)), dtype=np.float,
246+
% (n,v)), dtype=np.float64,
247247
shape=volshape, mode='w+')
248248
output[n] = tempdict
249249

250250
for n in fcons:
251251
output[n] = np.memmap(NamedTemporaryFile(prefix='%s%s.nii'
252-
% (n,v)), dtype=np.float,
252+
% (n,v)), dtype=np.float64,
253253
shape=volshape, mode='w+')
254254

255255
# Loop over the unique values of ar1

examples/fiac/fiac_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,13 @@ def run_model(subj, run):
231231
tempdict = {}
232232
for v in ['sd', 't', 'effect']:
233233
tempdict[v] = np.memmap(NamedTemporaryFile(prefix='%s%s.nii'
234-
% (n,v)), dtype=np.float,
234+
% (n,v)), dtype=np.float64,
235235
shape=volshape, mode='w+')
236236
output[n] = tempdict
237237

238238
for n in fcons:
239239
output[n] = np.memmap(NamedTemporaryFile(prefix='%s%s.nii'
240-
% (n,v)), dtype=np.float,
240+
% (n,v)), dtype=np.float64,
241241
shape=volshape, mode='w+')
242242

243243
# Loop over the unique values of ar1

examples/fiac/fiac_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,12 @@ def rewrite_spec(subj, run, root = "/home/jtaylo/FIAC-HBM2009"):
336336
# This is due to the FIAC design
337337

338338
if designtype == 'evt':
339-
b = np.array([(d[0]['time'], 1)], np.dtype([('time', np.float),
339+
b = np.array([(d[0]['time'], 1)], np.dtype([('time', np.float64),
340340
('initial', np.int)]))
341341
d = d[1:]
342342
else:
343343
k = np.equal(np.arange(d.shape[0]) % 6, 0)
344-
b = np.array([(tt, 1) for tt in d[k]['time']], np.dtype([('time', np.float),
344+
b = np.array([(tt, 1) for tt in d[k]['time']], np.dtype([('time', np.float64),
345345
('initial', np.int)]))
346346
d = d[~k]
347347

examples/formula/fir.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def anon(x,k1=k1,k2=k2,k3=k3):
4444

4545
# We're going to evaluate at these specific values of time
4646
tt = np.linspace(0,50,101)
47-
tvals= tt.view(np.dtype([('t', np.float)]))
47+
tvals= tt.view(np.dtype([('t', np.float64)]))
4848

4949
# Some inter-stimulus intervals
5050
isis = np.random.uniform(low=0, high=3, size=(4,)) + 10.

examples/formula/multi_session_contrast.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@
8484
# our case the terms are t1, t2, and the (indicator coding) terms from the run
8585
# factor.
8686
rec = np.array([(tv1, tv2, s) for tv1, tv2, s in zip(ttval1, ttval2, run_no)],
87-
np.dtype([('t1', np.float),
88-
('t2', np.float),
87+
np.dtype([('t1', np.float64),
88+
('t2', np.float64),
8989
('run', np.int)]))
9090

9191
# The contrast we care about

examples/formula/parametric_design.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
X3 = f3.design(tval, params, return_float=True)
4242

4343
# the columns or d/d_b0 and d/dl
44-
tt = tval.view(np.float)
44+
tt = tval.view(np.float64)
4545
v1 = np.sum([hrf.glovert(tt - s)*np.exp(-4.5*a) for s,a in zip(t, dt)], 0)
4646
v2 = np.sum([-3.5*a*hrf.glovert(tt - s)*np.exp(-4.5*a) for s,a in zip(t, dt)], 0)
4747

examples/interfaces/process_ds105.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def smooth(self, in_prefix='', out_prefix='s'):
274274
len(fwhm)
275275
except TypeError:
276276
fwhm = [fwhm] * 3
277-
fwhm = np.asarray(fwhm, dtype=np.float).reshape(1,3)
277+
fwhm = np.asarray(fwhm, dtype=np.float64).reshape(1,3)
278278
sess_scans = scans_for_fnames(
279279
fnames_presuffix(self.data_def['functionals'], in_prefix))
280280
sinfo = make_job('spatial', 'smooth',

examples/interfaces/process_fiac.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def smooth(data_def, fwhm=8.0):
166166
len(fwhm)
167167
except TypeError:
168168
fwhm = [fwhm] * 3
169-
fwhm = np.asarray(fwhm, dtype=np.float).reshape(1,3)
169+
fwhm = np.asarray(fwhm, dtype=np.float64).reshape(1,3)
170170
sess_scans = scans_for_fnames(fnames_presuffix(data_def['functionals'], 'wa'))
171171
sinfo = make_job('spatial', 'smooth',
172172
{'data':np.vstack(sess_scans.flat),

examples/labs/need_data/glm_beta_and_variance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,15 @@
105105
mask = fmri_glm.mask.get_data() > 0
106106

107107
# output beta images
108-
beta_map = np.tile(mask.astype(np.float)[..., np.newaxis], dim)
108+
beta_map = np.tile(mask.astype(np.float64)[..., np.newaxis], dim)
109109
beta_map[mask] = beta_hat.T
110110
beta_image = Nifti1Image(beta_map, fmri_glm.affine)
111111
beta_image.get_header()['descrip'] = (
112112
'Parameter estimates of the localizer dataset')
113113
save(beta_image, path.join(write_dir, 'beta.nii'))
114114
print("Beta image witten in %s" % write_dir)
115115

116-
variance_map = mask.astype(np.float)
116+
variance_map = mask.astype(np.float64)
117117
variance_map[mask] = variance_hat
118118

119119
# Create a snapshots of the variance image contrasts

nipy/algorithms/clustering/bgmm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def wishart_eval(n, V, W, dV=None, dW=None, piV=None):
146146
ltr = - np.trace(np.dot(piV, W)) / 2
147147
la = (n * p * math.log(2) + math.log(dV) * n) / 2
148148
lg = math.log(math.pi) * p * (p - 1) / 4
149-
lg += gammaln(np.arange(n - p + 1, n + 1).astype(np.float) / 2).sum()
149+
lg += gammaln(np.arange(n - p + 1, n + 1).astype(np.float64) / 2).sum()
150150
lt = ldW + ltr - la - lg
151151
return math.exp(lt)
152152

@@ -757,7 +757,7 @@ def conditional_posterior_proba(self, x, z, perm=None):
757757
By default, no permutation is performed
758758
"""
759759
pop = self.pop(z)
760-
rpop = (pop + (pop == 0)).astype(np.float)
760+
rpop = (pop + (pop == 0)).astype(np.float64)
761761
dof = self.prior_dof + pop + 1
762762
shrinkage = self.prior_shrinkage + pop
763763
weights = pop + self.prior_weights

0 commit comments

Comments
 (0)