From 7cea4ced6d8154fb3a5e526e6ac756ce10e8a275 Mon Sep 17 00:00:00 2001 From: "Eric T. Johnson" Date: Fri, 6 Sep 2024 13:55:35 -0400 Subject: [PATCH] Fix type check when pretty printing integer data (#260) I found this when running examples/mesh/bc_demo.py. --- pyro/mesh/array_indexer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyro/mesh/array_indexer.py b/pyro/mesh/array_indexer.py index eca661974..e9c7ece07 100644 --- a/pyro/mesh/array_indexer.py +++ b/pyro/mesh/array_indexer.py @@ -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" @@ -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"