Skip to content

Commit 7cea4ce

Browse files
authored
Fix type check when pretty printing integer data (#260)
I found this when running examples/mesh/bc_demo.py.
1 parent 0bd2446 commit 7cea4ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyro/mesh/array_indexer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def pretty_print(self, n=0, fmt=None, show_ghost=True):
280280
"""
281281

282282
if fmt is None:
283-
if isinstance(self.dtype.type, numbers.Integral):
283+
if issubclass(self.dtype.type, numbers.Integral):
284284
fmt = "%4d"
285285
elif self.dtype == np.float64:
286286
fmt = "%10.5g"
@@ -498,7 +498,7 @@ def pretty_print(self, n=0, fmt=None, show_ghost=True):
498498
"""
499499

500500
if fmt is None:
501-
if isinstance(self.dtype.type, numbers.Integral):
501+
if issubclass(self.dtype.type, numbers.Integral):
502502
fmt = "%4d"
503503
elif self.dtype == np.float64:
504504
fmt = "%10.5g"

0 commit comments

Comments
 (0)