Make sure from_ace classmethods get correct type of ACE table

This commit is contained in:
Paul Romano 2019-09-25 12:36:47 -05:00
parent a8d90844a3
commit 60f17ea466
3 changed files with 8 additions and 1 deletions

View file

@ -588,6 +588,9 @@ class IncidentNeutron(EqualityMixin):
# If mass number hasn't been specified, make an educated guess
zaid, xs = ace.name.split('.')
if not xs.endswith('c'):
raise TypeError(
"{} is not a continuous-energy neutron ACE table.".format(ace))
name, element, Z, mass_number, metastable = \
get_metadata(int(zaid), metastable_scheme)

View file

@ -549,7 +549,9 @@ class IncidentPhoton(EqualityMixin):
ace = get_table(ace_or_filename)
# Get atomic number based on name of ACE table
zaid = ace.name.split('.')[0]
zaid, xs = ace.name.split('.')
if not xs.endswith('p'):
raise TypeError("{} is not a photoatomic transport ACE table.".format(ace))
Z = get_metadata(int(zaid))[2]
# Read each reaction

View file

@ -600,6 +600,8 @@ class ThermalScattering(EqualityMixin):
# Get new name that is GND-consistent
ace_name, xs = ace.name.split('.')
if not xs.endswith('t'):
raise TypeError("{} is not a thermal scattering ACE table.".format(ace))
name = get_thermal_name(ace_name)
# Assign temperature to the running list