Skip to content

Commit

Permalink
Remove leading spaces from kinetics comments from libraries
Browse files Browse the repository at this point in the history
Otherwise, indents are retained over each read/write operation
  • Loading branch information
mliu49 authored and amarkpayne committed Aug 10, 2019
1 parent f67c64a commit 9bd9589
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rmgpy/data/kinetics/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ def getLibraryReactions(self):
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','')
# Clean up any leading indents in kinetics comment
entry.data.comment = '\n'.join([line.strip() for line in entry.data.comment.split('\n')])
rxn = LibraryReaction(reactants=entry.item.reactants[:], products=entry.item.products[:],
library=lib, specificCollider=entry.item.specificCollider, kinetics=entry.data,
duplicate=entry.item.duplicate, reversible=entry.item.reversible,
Expand All @@ -256,6 +258,8 @@ def getLibraryReactions(self):
template = re.split(r'\[(.*)\]', rule_part)[1] # Remove outer brackets and trailing text
elif 'family:' in line:
family = line.split('family:')[1].strip()
# Clean up any leading indents in kinetics comment
entry.data.comment = '\n'.join([line.strip() for line in entry.data.comment.split('\n')])
rxn = TemplateReaction(reactants=entry.item.reactants[:], products=entry.item.products[:],
specificCollider=entry.item.specificCollider, kinetics=entry.data,
duplicate=entry.item.duplicate, reversible=entry.item.reversible,
Expand Down

0 comments on commit 9bd9589

Please sign in to comment.