Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug with duplicate library reactions #1676

Merged
merged 2 commits into from
Aug 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions rmgpy/data/kinetics/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def getLibraryReactions(self):
"""
rxns = []
for entry in self.entries.values():
if entry._longDesc and 'Originally from reaction library: ' in entry._longDesc:
if self.autoGenerated and entry._longDesc and 'Originally from reaction library: ' in entry._longDesc:
lib = [line for line in entry._longDesc.split('\n') if 'Originally from reaction library: ' in line]
lib = lib[0].replace('Originally from reaction library: ','')
lib = lib.replace('\n','')
Expand All @@ -245,7 +245,8 @@ def getLibraryReactions(self):
duplicate=entry.item.duplicate, reversible=entry.item.reversible,
allow_pdep_route=entry.item.allow_pdep_route,
elementary_high_p=entry.item.elementary_high_p)
elif entry._longDesc and 'rate rule' in entry._longDesc: #template reaction
rxn.family = self.label #the library the reaction was loaded from (opposed to originally from)
alongd marked this conversation as resolved.
Show resolved Hide resolved
elif self.autoGenerated and entry._longDesc and 'rate rule' in entry._longDesc: #template reaction
c = entry._longDesc.split('\n')
family_comments = [i for i in c if 'family: ' in i]
familyname = family_comments[0].replace('family: ','')
Expand Down