Skip to content

Commit

Permalink
Remove spaces from input keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherMayes committed Dec 7, 2021
1 parent 5a87282 commit 0481a9a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion astra/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,16 @@ def clean_namelist_key_value(line):
"""
Cleans up a namelist "key = value line"
Removes all spaces, and makes the key lower case.
"""
z = line.split('=')
# Make key lower case, strip
return z[0].strip().lower()+' = '+''.join(z[1:])

key = z[0].strip().lower().replace(' ', '')
value = ''.join(z[1:])

return f'{key} = {value}'

def unroll_namelist_line(line, commentchar='!', condense=False ):
"""
Expand Down

0 comments on commit 0481a9a

Please sign in to comment.