Fix the bug in the Material.from_xml_element function (#3278)

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Skywalker 2025-01-28 15:57:27 +08:00 committed by GitHub
parent 8626ce5c43
commit 27f3afefa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1582,7 +1582,6 @@ class Material(IDManagerMixin):
if 'volume' in elem.attrib:
mat.volume = float(elem.get('volume'))
mat.depletable = bool(elem.get('depletable'))
# Get each nuclide
for nuclide in elem.findall('nuclide'):
@ -1592,6 +1591,9 @@ class Material(IDManagerMixin):
elif 'wo' in nuclide.attrib:
mat.add_nuclide(name, float(nuclide.attrib['wo']), 'wo')
# Get depletable attribute
mat.depletable = elem.get('depletable') in ('true', '1')
# Get each S(a,b) table
for sab in elem.findall('sab'):
fraction = float(sab.get('fraction', 1.0))