Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
David Keitel
PyFstat
Commits
4a00f518
Commit
4a00f518
authored
Mar 22, 2018
by
Gregory Ashton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update read_par to take strings as values
parent
1f081b93
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
pyfstat/core.py
pyfstat/core.py
+8
-4
No files found.
pyfstat/core.py
View file @
4a00f518
...
...
@@ -120,10 +120,14 @@ def _get_dictionary_from_lines(lines, comments, raise_error):
try
:
key
,
val
=
line
.
rstrip
(
'
\n
'
).
split
(
'='
)
key
=
key
.
strip
()
try
:
d
[
key
]
=
np
.
float64
(
eval
(
val
.
rstrip
(
'; '
)))
except
NameError
:
d
[
key
]
=
val
.
rstrip
(
'; '
)
val
=
val
.
strip
()
if
(
val
[
0
]
in
[
"'"
,
'"'
])
and
(
val
[
-
1
]
in
[
"'"
,
'"'
]):
d
[
key
]
=
val
.
lstrip
(
'"'
).
lstrip
(
"'"
).
rstrip
(
'"'
).
rstrip
(
"'"
)
else
:
try
:
d
[
key
]
=
np
.
float64
(
eval
(
val
.
rstrip
(
'; '
)))
except
NameError
:
d
[
key
]
=
val
.
rstrip
(
'; '
)
except
SyntaxError
:
if
raise_error
:
raise
IOError
(
'Line {} not understood'
.
format
(
line
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment