Skip to content
Snippets Groups Projects
Commit 4a00f518 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Update read_par to take strings as values

parent 1f081b93
Branches
Tags
No related merge requests found
...@@ -120,6 +120,10 @@ def _get_dictionary_from_lines(lines, comments, raise_error): ...@@ -120,6 +120,10 @@ def _get_dictionary_from_lines(lines, comments, raise_error):
try: try:
key, val = line.rstrip('\n').split('=') key, val = line.rstrip('\n').split('=')
key = key.strip() key = key.strip()
val = val.strip()
if (val[0] in ["'", '"']) and (val[-1] in ["'", '"']):
d[key] = val.lstrip('"').lstrip("'").rstrip('"').rstrip("'")
else:
try: try:
d[key] = np.float64(eval(val.rstrip('; '))) d[key] = np.float64(eval(val.rstrip('; ')))
except NameError: except NameError:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment