From c446f10e5add8af9020ae42c0010fedaab3946e6 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Mon, 10 Oct 2016 15:33:14 -0400 Subject: [PATCH] Last @paulromano comment I held off on. Didnt update all mgxs h5 libraries yet as future comments from others will require I do that anyways. --- openmc/mesh.py | 4 ++-- openmc/mgxs_library.py | 2 +- scripts/openmc-update-mgxs | 14 ++++++-------- tests/1d_mgxs.h5 | Bin 123864 -> 123864 bytes 4 files changed, 9 insertions(+), 11 deletions(-) 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 65dcf36cf7ee6c22d854c4fbcf2160e63209280f..401fe02fc54bedac6d1b5443db23a923de30c5f0 100644 GIT binary patch delta 1643 zcmZvcUr19?9LG8SUuE_XYChyYR1(E8O0ATcLKp=T#E>GcwwHvwCZy~-2hq z7$^tQ&TVW6Zbs1_*YYHp*T<~qaFOx8ZQ8JUP|<+55{ z^`P!-&;uvxIZtJ)OiVVRDkSTw-lOWN38{K6a@B{mg6geHqG}R4ce$CUD)wwJh^nL} z+AVUMv!W@zH-&iBpn268&rCBl@q=`YALQo1zjpV)u2zbJwp+FIa=yY`D{qVIOqbk_dP0B>I!vJfB=^f0{oIHa3A!Yg`5g>JXT+;kkK$Aum@pV4b5VS@LV zIvJ&wELk&>XZuB$byfhItni@bI#6{S=DlZ6V0s&J5cOXhp~TS zonG^9h@eDx=9?g_u7Pcn4Wu`v8(I8IOwIT!i!GhJ`~z0+vR>rnM)-U(5e0Uq{^!)_ zpO91769H5V#U2AF2$o|(I0-J>2f|U5xOfm`!GUq^Z=l3l>&(1W`u9P@EivCyG~{z#JSZ&BnPWqK%d*7N~xj(4g&$-)s)UZ{u&8zmH)=tbdfg3f!+dABp`=Hy;fdlEaw>8nbw*t^>aiOXM1N)U1@2km zc{0pVARX3c9U{+;)*Ixxll6<<+P1lnBl|s|b&a_(^Z-rvO=vjE?wi{tJ$c4xP=Lw{ z7F8HGdS#f8CUv@sX4utYjzr{;{-mI{HC6+IrOhF=U>R5Q8U;1aX{Khf_rZ#5nJ>Z=W_`Yv$QhjoJL&5NRH3OakKg{aET959Hg z&CRr1{$q_ZjC*Ho<8;~C1UG+^;Zvs z_A{Mg`^o5sQ!$;jzcawwHxF4gH0WV?<#AXyb%a;+j|$yxjd|%fOpOaYZakycP|^hN zF>O*qdW5B`M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