Skip to content

Commit 4d0624a

Browse files
committed
np.float -> float np.complex-> complex
1 parent a9b27b6 commit 4d0624a

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

examples/darray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Test DistArray. Start with alignment in axis 0, then tranfer to 2 and
77
# finally to 1
88
N = (16, 14, 12)
9-
z0 = DistArray(N, dtype=np.float, alignment=0)
9+
z0 = DistArray(N, dtype=float, alignment=0)
1010
z0[:] = np.random.randint(0, 10, z0.shape)
1111
s0 = MPI.COMM_WORLD.allreduce(np.sum(z0))
1212
z1 = z0.redistribute(2)

mpi4py_fft/distarray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class DistArray(np.ndarray):
5555
axis will be aligned, also when rank>0.
5656
5757
"""
58-
def __new__(cls, global_shape, subcomm=None, val=None, dtype=np.float,
58+
def __new__(cls, global_shape, subcomm=None, val=None, dtype=float,
5959
buffer=None, alignment=None, rank=0):
6060
if len(global_shape[rank:]) < 2: # 1D case
6161
obj = np.ndarray.__new__(cls, global_shape, dtype=dtype, buffer=buffer)

mpi4py_fft/io/nc_file.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self, ncname, domain=None, mode='a', clobber=True, **kw):
5454
self.dims = None
5555
if 'time' not in self.f.variables:
5656
self.f.createDimension('time', None)
57-
self.f.createVariable('time', np.float, ('time'))
57+
self.f.createVariable('time', float, ('time'))
5858
self.close()
5959

6060
def _check_domain(self, group, field):
@@ -77,15 +77,15 @@ def _check_domain(self, group, field):
7777
self.dims.append(ind)
7878
if not ind in self.f.variables:
7979
self.f.createDimension(ind, field.dimensions)
80-
n = self.f.createVariable(ind, np.float, (ind))
80+
n = self.f.createVariable(ind, float, (ind))
8181
n[:] = np.arange(field.dimensions)
8282

8383
for i in range(field.dimensions):
8484
xyz = 'xyzrst'[i]
8585
self.dims.append(xyz)
8686
if not xyz in self.f.variables:
8787
self.f.createDimension(xyz, N[i])
88-
nc_xyz = self.f.createVariable(xyz, np.float, (xyz))
88+
nc_xyz = self.f.createVariable(xyz, float, (xyz))
8989
nc_xyz[:] = self.domain[i]
9090

9191
self.f.sync()

mpi4py_fft/mpifft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def __init__(self, comm, shape=None, axes=None, dtype=float, grid=None,
248248
assert len(padding) == len(shape)
249249
for ax in axes:
250250
if len(ax) == 1 and padding[ax[0]] > 1.0+1e-6:
251-
old = np.float(shape[ax[0]])
251+
old = float(shape[ax[0]])
252252
shape[ax[0]] = int(np.floor(shape[ax[0]]*padding[ax[0]]))
253253
padding[ax[0]] = shape[ax[0]] / old
254254

mpi4py_fft/pencil.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ class Transfer(object):
138138
... axis = 2
139139
... p0 = Pencil(subcomms, N, axis)
140140
... p1 = p0.pencil(0)
141-
... transfer = p0.transfer(p1, np.float)
142-
... a0 = np.zeros(p0.subshape, dtype=np.float)
141+
... transfer = p0.transfer(p1, float)
142+
... a0 = np.zeros(p0.subshape, dtype=float)
143143
... a1 = np.zeros(p1.subshape)
144144
... a0[:] = np.random.random(a0.shape)
145145
... transfer.forward(a0, a1)

tests/test_io.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def test_2D(backend, forward_output):
2626
assert forward_output is False
2727
T = PFFT(comm, (N[0], N[1]))
2828
for i, domain in enumerate([None, ((0, np.pi), (0, 2*np.pi)),
29-
(np.arange(N[0], dtype=np.float)*1*np.pi/N[0],
30-
np.arange(N[1], dtype=np.float)*2*np.pi/N[1])]):
29+
(np.arange(N[0], dtype=float)*1*np.pi/N[0],
30+
np.arange(N[1], dtype=float)*2*np.pi/N[1])]):
3131
for rank in range(3):
3232
filename = "".join(('test2D_{}{}{}'.format(ex[i == 0], ex[forward_output], rank),
3333
ending[backend]))
@@ -66,9 +66,9 @@ def test_3D(backend, forward_output):
6666
assert forward_output is False
6767
T = PFFT(comm, (N[0], N[1], N[2]))
6868
d0 = ((0, np.pi), (0, 2*np.pi), (0, 3*np.pi))
69-
d1 = (np.arange(N[0], dtype=np.float)*1*np.pi/N[0],
70-
np.arange(N[1], dtype=np.float)*2*np.pi/N[1],
71-
np.arange(N[2], dtype=np.float)*3*np.pi/N[2])
69+
d1 = (np.arange(N[0], dtype=float)*1*np.pi/N[0],
70+
np.arange(N[1], dtype=float)*2*np.pi/N[1],
71+
np.arange(N[2], dtype=float)*3*np.pi/N[2])
7272
for i, domain in enumerate([None, d0, d1]):
7373
for rank in range(3):
7474
filename = ''.join(('test_{}{}{}'.format(ex[i == 0], ex[forward_output], rank),
@@ -129,10 +129,10 @@ def test_4D(backend, forward_output):
129129
assert forward_output is False
130130
T = PFFT(comm, (N[0], N[1], N[2], N[3]))
131131
d0 = ((0, np.pi), (0, 2*np.pi), (0, 3*np.pi), (0, 4*np.pi))
132-
d1 = (np.arange(N[0], dtype=np.float)*1*np.pi/N[0],
133-
np.arange(N[1], dtype=np.float)*2*np.pi/N[1],
134-
np.arange(N[2], dtype=np.float)*3*np.pi/N[2],
135-
np.arange(N[3], dtype=np.float)*4*np.pi/N[3]
132+
d1 = (np.arange(N[0], dtype=float)*1*np.pi/N[0],
133+
np.arange(N[1], dtype=float)*2*np.pi/N[1],
134+
np.arange(N[2], dtype=float)*3*np.pi/N[2],
135+
np.arange(N[3], dtype=float)*4*np.pi/N[3]
136136
)
137137
for i, domain in enumerate([None, d0, d1]):
138138
for rank in range(3):

0 commit comments

Comments
 (0)