Skip to content

Commit 6a000f7

Browse files
rwestconnie
authored andcommitted
Tweak to species constraint allowed molecule list.
I'm not 100% sure we've generated resonance isomers at this point, so this change may not be enough, but I feel we should allow all resonance forms of an allowed species.
1 parent 143aa96 commit 6a000f7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

rmgpy/rmg/model.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,8 +1293,7 @@ def addSeedMechanismToCore(self, seedMechanism, react=False):
12931293
raise ForbiddenStructureException("Species {0} from seed mechanism {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, seedMechanism.label))
12941294
if self.failsSpeciesConstraints(spec):
12951295
if 'allowed' in self.speciesConstraints and 'seed mechanisms' in self.speciesConstraints['allowed']:
1296-
self.speciesConstraints['explicitlyAllowedMolecules'].append(spec.molecule[0])
1297-
pass
1296+
self.speciesConstraints['explicitlyAllowedMolecules'].extend(spec.molecule)
12981297
else:
12991298
raise ForbiddenStructureException("Species constraints forbids species {0} from seed mechanism {1}. Please reformulate constraints, remove the species, or explicitly allow it.".format(spec.label, seedMechanism.label))
13001299

@@ -1357,8 +1356,7 @@ def addReactionLibraryToEdge(self, reactionLibrary):
13571356
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))
13581357
if self.failsSpeciesConstraints(spec):
13591358
if 'allowed' in self.speciesConstraints and 'reaction libraries' in self.speciesConstraints['allowed']:
1360-
self.speciesConstraints['explicitlyAllowedMolecules'].append(spec.molecule[0])
1361-
pass
1359+
self.speciesConstraints['explicitlyAllowedMolecules'].extend(spec.molecule)
13621360
else:
13631361
raise ForbiddenStructureException("Species constraints forbids species {0} from reaction library {1}. Please reformulate constraints, remove the species, or explicitly allow it.".format(spec.label, reactionLibrary.label))
13641362

0 commit comments

Comments
 (0)