Commit c738d7db authored by Frederik Zahle's avatar Frederik Zahle
Browse files

fix if statement of None that crashes in newer versions of numpy

parent 2c633414
Pipeline #4815 passed with stage
in 2 minutes and 43 seconds
......@@ -123,7 +123,7 @@ def read_plot3d_f(d, filename,name='block',single_precision=False):
nt = ni * nj * nk
# xt = xt.reshape(3, nt)
# split into x, y, z and reshape into ni, nj, nk
x = xt.reshape(nk,nj,ni).swapaxes(0,2)
x = xt.reshape(nk,nj,ni, bsizes[n, -1]).swapaxes(0,2)
b.attr = x.copy()
f.close()
......@@ -1126,7 +1126,7 @@ class Block(object):
self.x[:,:,0] = x
self.y[:,:,0] = y
self.z[:,:,0] = z
if attr == None:
if not isinstance(attr, np.ndarray):
self.attr = np.ones((self.ni, self.nj, self.nk))
else:
# print 'setting attr', attr.min(), attr.max(), attr.shape
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment