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
386c64df
Commit
386c64df
authored
6 years ago
by
Markus Scheidgen
Browse files
Options
Downloads
Patches
Plain Diff
Added support for compressed .xml files.
parent
05e5f608
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
vaspparser/__init__.py
+11
-2
11 additions, 2 deletions
vaspparser/__init__.py
with
11 additions
and
2 deletions
vaspparser/__init__.py
+
11
−
2
View file @
386c64df
...
...
@@ -14,6 +14,8 @@
import
os
import
logging
import
gzip
import
bz2
from
nomadcore.baseclasses
import
ParserInterface
import
nomadcore.baseclasses
...
...
@@ -26,7 +28,7 @@ from vaspparser.parser_outcar import VaspOutcarParser
class
VASPRunParser
:
"""
The main parser class that is called for all run types. Parses the VASP
.
out
output files.
.
xml
output files.
"""
def
__init__
(
self
,
parser_context
):
self
.
parser_context
=
parser_context
...
...
@@ -36,7 +38,14 @@ class VASPRunParser:
superContext
=
VasprunContext
(
logger
=
nomadcore
.
baseclasses
.
logger
)
parser
=
XmlParser
(
parserInfo
,
superContext
)
backend
=
self
.
parser_context
.
super_backend
parser
.
parse
(
os
.
path
.
abspath
(
filepath
),
open
(
filepath
),
backend
)
open_file
=
open
if
filepath
.
endswith
(
'
.gz
'
):
open_file
=
gzip
.
open
elif
filepath
.
endswith
(
'
.bz2
'
):
open_file
=
bz2
.
open
parser
.
parse
(
os
.
path
.
abspath
(
filepath
),
open_file
(
filepath
,
'
rt
'
),
backend
)
class
VASPRunParserInterface
(
ParserInterface
):
...
...
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