From 39e21f75271f186a9414401158d05c2455cb5208 Mon Sep 17 00:00:00 2001 From: Flan Date: Fri, 25 Mar 2016 14:07:43 -0500 Subject: [PATCH] putting in a temporary catch for missing ace files --- pyne/xs/data_source.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pyne/xs/data_source.py b/pyne/xs/data_source.py index 5186669dab..7f387f9fe5 100644 --- a/pyne/xs/data_source.py +++ b/pyne/xs/data_source.py @@ -934,14 +934,15 @@ def _load_reaction(self, nuc, rx, temp=300.0): ace_tables = self._rank_ace_tables(nuc, temp=temp) lib = ntab = None for atab in ace_tables: - if atab not in self.libs: - lib = self.libs[atab] = ace.Library(atab.abspath or atab.path) - lib.read(atab.name) - lib = self.libs[atab] - ntab = lib.tables[atab.name] - if mt in ntab.reactions or rx == totrx or rx == absrx: - break - lib = ntab = None + if os.path.isfile(atab.abspath or atab.path): + if atab not in self.libs: + lib = self.libs[atab] = ace.Library(atab.abspath or atab.path) + lib.read(atab.name) + lib = self.libs[atab] + ntab = lib.tables[atab.name] + if mt in ntab.reactions or rx == totrx or rx == absrx: + break + lib = ntab = None if lib is None: return None # no reaction available E_g = self.src_group_struct @@ -990,5 +991,6 @@ def load(self, temp=300.0): """ for atab in self.cross_sections.ace_tables: - lib = self.libs[atab] = ace.Library(atab.abspath or atab.path) - lib.read(atab.name) + if os.path.isfile(atab.abspath or atab.path): + lib = self.libs[atab] = ace.Library(atab.abspath or atab.path) + lib.read(atab.name)