Skip to content

Commit ada4d3a

Browse files
authored
np.int is deprecated in np.1.20 (#137)
1 parent 8580c74 commit ada4d3a

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

pyro/analysis/gauss_diffusion_compare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def process(file):
5858
rmin = 0
5959
rmax = np.sqrt(myg.xmax**2 + myg.ymax**2)
6060

61-
nbins = np.int(np.sqrt(myg.nx**2 + myg.ny**2))
61+
nbins = int(np.sqrt(myg.nx**2 + myg.ny**2))
6262

6363
# bins holds the edges, so there is one more value than actual bin
6464
# bin_centers holds the center value of the bin

pyro/analysis/sedov_compare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
rmin = 0
6969
rmax = np.sqrt(myg.xmax**2 + myg.ymax**2)
7070

71-
nbins = np.int(np.sqrt(myg.nx**2 + myg.ny**2))
71+
nbins = int(np.sqrt(myg.nx**2 + myg.ny**2))
7272

7373
# bins holds the edges, so there is one more value than actual bin
7474
# bin_centers holds the center value of the bin

pyro/mesh/array_indexer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"""
55

66

7+
import numbers
8+
79
import numpy as np
810

911

@@ -281,7 +283,7 @@ def pretty_print(self, n=0, fmt=None, show_ghost=True):
281283
"""
282284

283285
if fmt is None:
284-
if self.dtype == np.int:
286+
if isinstance(self.dtype.type, numbers.Integral):
285287
fmt = "%4d"
286288
elif self.dtype == np.float64:
287289
fmt = "%10.5g"
@@ -502,7 +504,7 @@ def pretty_print(self, n=0, fmt=None, show_ghost=True):
502504
"""
503505

504506
if fmt is None:
505-
if self.dtype == np.int:
507+
if isinstance(self.dtype.type, numbers.Integral):
506508
fmt = "%4d"
507509
elif self.dtype == np.float64:
508510
fmt = "%10.5g"

0 commit comments

Comments
 (0)