Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-vasp
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nomad-lab
parser-vasp
Commits
1925409d
Commit
1925409d
authored
7 years ago
by
Simoes Brambila, Danilo (brambila)
Browse files
Options
Downloads
Patches
Plain Diff
fixing conversion of ***float to NaN
parent
f6f6463d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
parser/parser-vasp/parser_vasprun.py
+7
-2
7 additions, 2 deletions
parser/parser-vasp/parser_vasprun.py
with
7 additions
and
2 deletions
parser/parser-vasp/parser_vasprun.py
+
7
−
2
View file @
1925409d
...
...
@@ -216,12 +216,17 @@ class MyXMLParser(ET.XMLParser):
else
:
mydata
=
data
super
(
MyXMLParser
,
self
).
feed
(
mydata
)
def
transform2
(
y
):
if
'
**
'
in
y
:
return
float
(
'
nan
'
)
else
:
return
y
def
getVector
(
el
,
transform
=
float
,
field
=
"
v
"
):
"""
returns the vasp style vector contained in the element el (using field v).
single elements are converted using the function convert
"""
return
[[
transform
(
y
)
for
y
in
re
.
split
(
r
"
\s+
"
,
x
.
text
.
strip
())]
for
x
in
el
.
findall
(
field
)]
#
# for x in el.findall(field):
# for y in re.split(r"\s+", x.text.strip()):
return
[[
transform
(
transform2
(
y
))
for
y
in
re
.
split
(
r
"
\s+
"
,
x
.
text
.
strip
())]
for
x
in
el
.
findall
(
field
)]
class
VasprunContext
(
object
):
def
__init__
(
self
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment