Skip to content

Commit

Permalink
Allows RMG to continue when there is a duplicate species
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
keceli committed Nov 25, 2013
1 parent fcb5c20 commit f9dea82
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions rmgpy/rmg/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,12 @@ def database(
def species(label, structure, reactive=True):
logging.debug('Found {0} species "{1}" ({2})'.format('reactive' if reactive else 'nonreactive', label, structure.toSMILES()))
spec, isNew = rmg.reactionModel.makeNewSpecies(structure, label=label, reactive=reactive)
assert isNew, "Species {0} is a duplicate of {1}. Species in input file must be unique".format(label,spec.label)
rmg.initialSpecies.append(spec)
speciesDict[label] = spec
#assert isNew, "Species {0} is a duplicate of {1}. Species in input file must be unique".format(label,spec.label)
if isNew:
rmg.initialSpecies.append(spec)
speciesDict[label] = spec
else:
logging.info("Species {0} is a duplicate of {1}. Avoid it and continue calculation ...".format(label,spec.label))

This comment has been minimized.

Copy link
@rwest

rwest Dec 21, 2013

Member

I think this should at least be a warning, and perhaps make it clearer that RMG is ignoring it.

This comment has been minimized.

Copy link
@keceli

keceli Dec 31, 2013

Author

Changed the logging level to warning with 8740056598a53373765900a9b2b7a4148c513c07.


def SMARTS(string):
return Molecule().fromSMARTS(string)
Expand Down

0 comments on commit f9dea82

Please sign in to comment.