diff --git a/openmc/mesh.py b/openmc/mesh.py index 2d5fda09bc..014cbc4679 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -302,8 +302,8 @@ class Mesh(object): # inconsistency between what numpy uses as the max float and what # Fortran expects for a real(8), so this avoids code complication # and achieves the same goal. - zplanes = [openmc.ZPlane(z0=-1e10., boundary_type='reflective'), - openmc.ZPlane(z0=1e10., boundary_type='reflective')] + zplanes = [openmc.ZPlane(z0=-1e10, boundary_type='reflective'), + openmc.ZPlane(z0=1e10, boundary_type='reflective')] else: zplanes = [openmc.ZPlane(z0=self.lower_left[2], boundary_type=bc[4]), diff --git a/openmc/mgxs_library.py b/openmc/mgxs_library.py index 2bc320b7b7..8e6089a1a5 100644 --- a/openmc/mgxs_library.py +++ b/openmc/mgxs_library.py @@ -306,7 +306,7 @@ class XSdata(object): def temperatures(self, temperatures): check_iterable_type('temperatures', temperatures, Real) - self._temperatures = temperatures + self._temperatures = np.array(temperatures) @scatter_format.setter def scatter_format(self, scatter_format): diff --git a/scripts/openmc-update-mgxs b/scripts/openmc-update-mgxs index 5d9591627a..f16ad9d1bb 100755 --- a/scripts/openmc-update-mgxs +++ b/scripts/openmc-update-mgxs @@ -63,17 +63,15 @@ def parse_args(): def get_data(element, entry): - try: - value = element.find(entry).text - except: + value = element.find(entry) + if value is not None: + value = value.text.strip() + else: if entry in element.attrib: - value = element.attrib[entry] + value = element.attrib[entry].strip() else: value = None - if value is not None: - value = value.strip() - return value @@ -140,7 +138,7 @@ if __name__ == '__main__': try: # It is in our list, so store that entry i = names.index(name) - except: + except ValueError: # It is not in our list, so add it i = -1 xsd.append(openmc.XSdata(name, energy_groups, diff --git a/tests/1d_mgxs.h5 b/tests/1d_mgxs.h5 index 65dcf36cf7..401fe02fc5 100644 Binary files a/tests/1d_mgxs.h5 and b/tests/1d_mgxs.h5 differ