Respond to comments on #692 and make a few little fixes

This commit is contained in:
Paul Romano 2016-08-08 06:49:24 -05:00
parent a15e493dab
commit d8b9d78a23
5 changed files with 17 additions and 6 deletions

View file

@ -64,7 +64,9 @@ if args.xml is not None:
directory = os.path.dirname(args.xml)
for ace_table in root.findall('ace_table'):
ace_libraries.append(os.path.join(directory, ace_table.attrib['path']))
path = os.path.join(directory, ace_table.attrib['path'])
if path not in ace_libraries:
ace_libraries.append(path)
elif args.xsdir is not None:
# Find 'directory' section
@ -116,8 +118,12 @@ for filename in ace_libraries:
for table in lib.tables:
if table.name.endswith('c'):
# Continuous-energy neutron data
neutron = openmc.data.IncidentNeutron.from_ace(
table, args.metastable)
try:
neutron = openmc.data.IncidentNeutron.from_ace(
table, args.metastable)
except Exception as e:
print('Failed to convert {}: {}'.format(table.name, e))
continue
print('Converting {} (ACE) to {} (HDF5)'.format(table.name, neutron.name))
# Determine filename