Skip to content

Commit

Permalink
Fix type check when pretty printing integer data (#260)
Browse files Browse the repository at this point in the history
I found this when running examples/mesh/bc_demo.py.
  • Loading branch information
yut23 authored Sep 6, 2024
1 parent 0bd2446 commit 7cea4ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyro/mesh/array_indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def pretty_print(self, n=0, fmt=None, show_ghost=True):
"""

if fmt is None:
if isinstance(self.dtype.type, numbers.Integral):
if issubclass(self.dtype.type, numbers.Integral):
fmt = "%4d"
elif self.dtype == np.float64:
fmt = "%10.5g"
Expand Down Expand Up @@ -498,7 +498,7 @@ def pretty_print(self, n=0, fmt=None, show_ghost=True):
"""

if fmt is None:
if isinstance(self.dtype.type, numbers.Integral):
if issubclass(self.dtype.type, numbers.Integral):
fmt = "%4d"
elif self.dtype == np.float64:
fmt = "%10.5g"
Expand Down

0 comments on commit 7cea4ce

Please sign in to comment.