From fe76fa524111a17c1e228a6fe2dfe2c08810e9f9 Mon Sep 17 00:00:00 2001 From: Mark Payne Date: Sun, 23 Jun 2019 19:09:11 -0400 Subject: [PATCH] Do not perform forbidden species checking for auto generated libraries We now perform this check when/if these edge species are moved to the core --- rmgpy/rmg/model.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/rmgpy/rmg/model.py b/rmgpy/rmg/model.py index 81873620506..c4f50fc89ad 100644 --- a/rmgpy/rmg/model.py +++ b/rmgpy/rmg/model.py @@ -1535,12 +1535,13 @@ def addReactionLibraryToEdge(self, reactionLibrary): # Perform species constraints and forbidden species checks for spec in self.newSpeciesList: - if database.forbiddenStructures.isMoleculeForbidden(spec.molecule[0]): - if 'allowed' in rmg.speciesConstraints and 'reaction libraries' in rmg.speciesConstraints['allowed']: - spec.explicitlyAllowed = True - logging.warning("Species {0} from reaction library {1} is globally forbidden. It will behave as an inert unless found in a seed mechanism or reaction library.".format(spec.label, reactionLibrary.label)) - else: - raise ForbiddenStructureException("Species {0} from reaction library {1} is globally forbidden. You may explicitly allow it, but it will remain inert unless found in a seed mechanism or reaction library.".format(spec.label, reactionLibrary.label)) + if not reactionLibrary.autoGenerated: # No need to check for forbidden species otherwise + if database.forbiddenStructures.isMoleculeForbidden(spec.molecule[0]): + if 'allowed' in rmg.speciesConstraints and 'reaction libraries' in rmg.speciesConstraints['allowed']: + spec.explicitlyAllowed = True + logging.warning("Species {0} from reaction library {1} is globally forbidden. It will behave as an inert unless found in a seed mechanism or reaction library.".format(spec.label, reactionLibrary.label)) + else: + raise ForbiddenStructureException("Species {0} from reaction library {1} is globally forbidden. You may explicitly allow it, but it will remain inert unless found in a seed mechanism or reaction library.".format(spec.label, reactionLibrary.label)) if failsSpeciesConstraints(spec): if 'allowed' in rmg.speciesConstraints and 'reaction libraries' in rmg.speciesConstraints['allowed']: rmg.speciesConstraints['explicitlyAllowedMolecules'].extend(spec.molecule)