Skip to content

Commit

Permalink
Fix future warnings on using not integer indices
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Tranter committed Feb 16, 2017
1 parent 30cd1f3 commit 168b583
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion OpenPNM/Network/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ def _template_sphere_disc(dim, outer_radius, inner_radius):
rmax = _np.array(outer_radius, ndmin=1)
rmin = _np.array(inner_radius, ndmin=1)
ind = 2 * rmax - 1
coord = _np.indices((ind * _np.ones(dim)))
coord = _np.indices((ind * _np.ones(dim, dtype=int)))
coord = coord - (ind - 1)/2
x = coord[0, :]
y = coord[1, :]
Expand Down
4 changes: 2 additions & 2 deletions OpenPNM/Utilities/IO.py
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ def load(path, network=None, voxel_size=1):
net['pore.ID_number'][i] = ID
net['pore.boundary_type'][i] = _sp.fromfile(file=f, count=1,
dtype='u1')
z = _sp.fromfile(file=f, count=1, dtype='u4')
z = _sp.fromfile(file=f, count=1, dtype='u4')[0]
net['pore.coordination'][i] = z
att_pores = _sp.fromfile(file=f, count=z, dtype='u4')
att_throats = _sp.fromfile(file=f, count=z, dtype='u4')
Expand All @@ -1056,7 +1056,7 @@ def load(path, network=None, voxel_size=1):
net['pore.coords'] = _sp.array([ni, nj, nk]).T

with open(th2np_file, mode='rb') as f:
Nt = _sp.fromfile(file=f, count=1, dtype='u4')
Nt = _sp.fromfile(file=f, count=1, dtype='u4')[0]
net['throat.area'] = _sp.ones([Nt, ], dtype=int)*(-1)
for i in range(0, Nt):
ID = _sp.fromfile(file=f, count=1, dtype='u4')
Expand Down

0 comments on commit 168b583

Please sign in to comment.