Skip to content

Commit

Permalink
Do not perform forbidden species checking for auto generated libraries
Browse files Browse the repository at this point in the history
We now perform this check when/if these edge species are moved to the core
  • Loading branch information
amarkpayne committed Jun 25, 2019
1 parent 30d6780 commit fe76fa5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions rmgpy/rmg/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fe76fa5

Please sign in to comment.