From 3e165c0d5457c296f03f48803aee8a992290001c Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 20 Jun 2019 08:26:43 -0500 Subject: [PATCH] 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 ``` ``` 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. --- openmc/element.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmc/element.py b/openmc/element.py index 336d1f028b..5b2a878a86 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -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: