Skip to content

Commit f9dea82

Browse files
committed
Allows RMG to continue when there is a duplicate species
Originally, RMG stops if any two species are identical in the initial species list. Since this can happen frequently when using thermoEstimator with a large list of spcies, I changed it, so that RMG ignores the duplicate, and continue execution.
1 parent fcb5c20 commit f9dea82

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

rmgpy/rmg/input.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,12 @@ def database(
9292
def species(label, structure, reactive=True):
9393
logging.debug('Found {0} species "{1}" ({2})'.format('reactive' if reactive else 'nonreactive', label, structure.toSMILES()))
9494
spec, isNew = rmg.reactionModel.makeNewSpecies(structure, label=label, reactive=reactive)
95-
assert isNew, "Species {0} is a duplicate of {1}. Species in input file must be unique".format(label,spec.label)
96-
rmg.initialSpecies.append(spec)
97-
speciesDict[label] = spec
95+
#assert isNew, "Species {0} is a duplicate of {1}. Species in input file must be unique".format(label,spec.label)
96+
if isNew:
97+
rmg.initialSpecies.append(spec)
98+
speciesDict[label] = spec
99+
else:
100+
logging.info("Species {0} is a duplicate of {1}. Avoid it and continue calculation ...".format(label,spec.label))
98101

99102
def SMARTS(string):
100103
return Molecule().fromSMARTS(string)

0 commit comments

Comments
 (0)