From 3a021a2438788bf9dd67ce0144d75a80e8a346ae Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 20 Sep 2016 11:35:29 -0500 Subject: [PATCH] When adding temperature data, give warning instead of error if MT not present. --- openmc/data/neutron.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openmc/data/neutron.py b/openmc/data/neutron.py index 2431ba74a..c638dfd9b 100644 --- a/openmc/data/neutron.py +++ b/openmc/data/neutron.py @@ -320,11 +320,11 @@ class IncidentNeutron(EqualityMixin): # Add normal and summed reactions for mt in chain(data.reactions, data.summed_reactions): - if mt not in self: - raise ValueError("Tried to add cross sections for MT={} at T={}" - " but this reaction doesn't exist.".format( - mt, strT)) - self[mt].xs[strT] = data[mt].xs[strT] + if mt in self: + self[mt].xs[strT] = data[mt].xs[strT] + else: + warn("Tried to add cross sections for MT={} at T={} but this " + "reaction doesn't exist.".format(mt, strT)) # Add probability tables if strT in data.urr: