From ca58e1407388a66bc9890c524197cc44ca4d9e7c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 23 Jan 2022 14:03:18 -0600 Subject: [PATCH] Apply suggestions from @pshriwise code review Co-authored-by: Patrick Shriwise --- openmc/filter.py | 4 ++-- openmc/lib/mesh.py | 6 +++--- openmc/trigger.py | 2 +- src/mesh.cpp | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/openmc/filter.py b/openmc/filter.py index fbbc855c28..65255bd3d4 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -254,7 +254,7 @@ class Filter(IDManagerMixin, metaclass=FilterMeta): filter_type = elem.get('type') # If the filter type matches this class's short_name, then - # there is no overriden from_xml_element method. + # there is no overriden from_xml_element method if filter_type == cls.short_name.lower(): # Get bins from element -- the default here works for any filters # that just store a list of bins that can be represented as integers @@ -263,7 +263,7 @@ class Filter(IDManagerMixin, metaclass=FilterMeta): return cls(bins, filter_id=filter_id) # Search through all subclasses and find the one matching the HDF5 - # 'type'. Call that class's from_hdf5 method. + # 'type'. Call that class's from_hdf5 method for subclass in cls._recursive_subclasses(): if filter_type == subclass.short_name.lower(): return subclass.from_xml_element(elem, **kwargs) diff --git a/openmc/lib/mesh.py b/openmc/lib/mesh.py index df64eee30e..84571628c6 100644 --- a/openmc/lib/mesh.py +++ b/openmc/lib/mesh.py @@ -290,11 +290,11 @@ class RectilinearMesh(Mesh): Parameters ---------- x_grid : iterable of float - Mesh boundary points along the x-axis. + Mesh boundary points along the x-axis y_grid : iterable of float - Mesh boundary points along the y-axis. + Mesh boundary points along the y-axis z_grid : iterable of float - Mesh boundary points along the z-axis. + Mesh boundary points along the z-axis """ nx = len(x_grid) diff --git a/openmc/trigger.py b/openmc/trigger.py index 550f7ee312..c5151aa7e0 100644 --- a/openmc/trigger.py +++ b/openmc/trigger.py @@ -88,7 +88,7 @@ class Trigger(EqualityMixin): element.set("type", self._trigger_type) element.set("threshold", str(self._threshold)) if len(self._scores) != 0: - element.set("scores", ' '.join(map(str, self._scores))) + element.set("scores", ' '.join(self._scores)) return element @classmethod diff --git a/src/mesh.cpp b/src/mesh.cpp index 9d5da29e9b..9310248c39 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1001,7 +1001,7 @@ double CylindricalMesh::find_r_crossing( double CylindricalMesh::find_phi_crossing( const Position& r, const Direction& u, double l, int shell) const { - // Phi grid is [0, 2pi], thus there is no real surface to cross + // Phi grid is [0, 2π], thus there is no real surface to cross if (full_phi_ && (shape_[1] == 1)) return INFTY; @@ -1221,7 +1221,7 @@ double SphericalMesh::find_r_crossing( double SphericalMesh::find_theta_crossing( const Position& r, const Direction& u, double l, int shell) const { - // Theta grid is [0, pi], thus there is no real surface to cross + // Theta grid is [0, π], thus there is no real surface to cross if (full_theta_ && (shape_[1] == 1)) return INFTY; @@ -1283,7 +1283,7 @@ double SphericalMesh::find_theta_crossing( double SphericalMesh::find_phi_crossing( const Position& r, const Direction& u, double l, int shell) const { - // Phi grid is [0, 2pi], thus there is no real surface to cross + // Phi grid is [0, 2π], thus there is no real surface to cross if (full_phi_ && (shape_[2] == 1)) return INFTY;