mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Respond to comments on #692 and make a few little fixes
This commit is contained in:
parent
a15e493dab
commit
d8b9d78a23
5 changed files with 17 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue