From 8b6e49df4738b78df40ee91c9cfc963570fd9738 Mon Sep 17 00:00:00 2001 From: Ethan Peterson Date: Fri, 25 Feb 2022 10:35:26 -0500 Subject: [PATCH] fixing logic for spherical mesh string repr --- openmc/mesh.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 1f17dbae296..6c210ae5963 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -960,19 +960,19 @@ def __repr__(self): fmt = '{0: <16}{1}{2}\n' string = super().__repr__() string += fmt.format('\tDimensions', '=\t', self.n_dimension) - r_grid_str = str(self._r_grid) if not self._r_grid else len(self._r_grid) + r_grid_str = str(self._r_grid) if self._r_grid is None else len(self._r_grid) string += fmt.format('\tN R pnts:', '=\t', r_grid_str) - if self._r_grid: + if self._r_grid is not None: string += fmt.format('\tR Min:', '=\t', self._r_grid[0]) string += fmt.format('\tR Max:', '=\t', self._r_grid[-1]) - theta_grid_str = str(self._theta_grid) if not self._theta_grid else len(self._theta_grid) + theta_grid_str = str(self._theta_grid) if self._theta_grid is None else len(self._theta_grid) string += fmt.format('\tN Theta pnts:', '=\t', theta_grid_str) - if self._theta_grid: + if self._theta_grid is not None: string += fmt.format('\tTheta Min:', '=\t', self._theta_grid[0]) string += fmt.format('\tTheta Max:', '=\t', self._theta_grid[-1]) - phi_grid_str = str(self._phi_grid) if not self._phi_grid else len(self._phi_grid) + phi_grid_str = str(self._phi_grid) if self._phi_grid is None else len(self._phi_grid) string += fmt.format('\tN Phi pnts:', '=\t', phi_grid_str) - if self._phi_grid: + if self._phi_grid is not None: string += fmt.format('\tPhi Min:', '=\t', self._phi_grid[0]) string += fmt.format('\tPhi Max:', '=\t', self._phi_grid[-1]) return string