Iterate over all libraries, not children, in Element.expand

After PR #1247, the cross section file is allowed to contain
the depletion chain file. This is present as a new tag, of
the form
```
   <depletion_chain path="path.xml" type="depletion_chain" />
```

The Element.expand method looked for `material` attributes
in all children of the OPENMC_CROSS_SECTION file.
This caused an error for the depletion_chain element.
Now, only those children with the `library` tag are
iterated over.
This commit is contained in:
Andrew Johnson 2019-06-20 08:26:43 -05:00
parent 2c0b16e73d
commit 3e165c0d54
No known key found for this signature in database
GPG key ID: 253418E91B7F6FEB

View file

@ -98,7 +98,7 @@ class Element(str):
library_nuclides = set()
tree = ET.parse(cross_sections)
root = tree.getroot()
for child in root:
for child in root.findall('library'):
nuclide = child.attrib['materials']
if re.match(r'{}\d+'.format(self), nuclide) and \
'_m' not in nuclide: