Skip to content

Commit 6d94f5e

Browse files
authored
Merge pull request #1371 from ReactionMechanismGenerator/filterResurrection
Allow Resurrection from Failed Filter Simulations
2 parents 02926fc + 1c6066e commit 6d94f5e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

rmgpy/rmg/main.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,8 @@ def execute(self, **kwargs):
723723
# Run a raw simulation to get updated reaction system threshold values
724724
# Run with the same conditions as with pruning off
725725
if not resurrected:
726-
reactionSystem.simulate(
726+
try:
727+
reactionSystem.simulate(
727728
coreSpecies = self.reactionModel.core.species,
728729
coreReactions = self.reactionModel.core.reactions,
729730
edgeSpecies = [],
@@ -735,9 +736,16 @@ def execute(self, **kwargs):
735736
simulatorSettings = simulatorSettings,
736737
conditions = self.rmg_memories[index].get_cond()
737738
)
738-
self.updateReactionThresholdAndReactFlags(
739+
except:
740+
self.updateReactionThresholdAndReactFlags(
741+
rxnSysUnimolecularThreshold = reactionSystem.unimolecularThreshold,
742+
rxnSysBimolecularThreshold = reactionSystem.bimolecularThreshold, skipUpdate=True)
743+
logging.warn('Reaction thresholds/flags for Reaction System {0} was not updated due to simulation failure'.format(index+1))
744+
else:
745+
self.updateReactionThresholdAndReactFlags(
739746
rxnSysUnimolecularThreshold = reactionSystem.unimolecularThreshold,
740747
rxnSysBimolecularThreshold = reactionSystem.bimolecularThreshold)
748+
741749
else:
742750
self.updateReactionThresholdAndReactFlags(
743751
rxnSysUnimolecularThreshold = reactionSystem.unimolecularThreshold,

0 commit comments

Comments
 (0)