Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
parser-cp2k
Commits
68bf2b9c
Commit
68bf2b9c
authored
Apr 27, 2016
by
Lauri Himanen
Browse files
Moved the baseclasses to nomadcore, updated files accordingly. Fixed some old documentation.
parent
4fc00e8b
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
parser/parser-cp2k/cp2kparser/generic/baseclasses.py
deleted
100644 → 0
View file @
4fc00e8b
This diff is collapsed.
Click to expand it.
parser/parser-cp2k/cp2kparser/parser.py
View file @
68bf2b9c
import
os
import
re
import
logging
from
cp2kparser.generic
.baseclasses
import
ParserInterface
from
nomadcore
.baseclasses
import
ParserInterface
from
cp2kparser.versions.versionsetup
import
get_main_parser
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -10,7 +10,7 @@ logger = logging.getLogger(__name__)
class
CP2KParser
(
ParserInterface
):
"""This class handles the initial setup before any parsing can happen. It
determines which version of CP2K was used to generate the output and then
sets up a correct
implementation
.
sets up a correct
main parser
.
After the implementation has been setup, you can parse the files with
parse().
...
...
parser/parser-cp2k/cp2kparser/setup_paths.py
View file @
68bf2b9c
"""
Setups the python-common lirary in the PYTHONPATH system variable.
Setups the python-common li
b
rary in the PYTHONPATH system variable.
"""
import
sys
import
os
...
...
parser/parser-cp2k/cp2kparser/versions/cp2k262/inputparser.py
View file @
68bf2b9c
...
...
@@ -2,7 +2,7 @@ import os
import
logging
import
cPickle
as
pickle
import
numpy
as
np
from
cp2kparser.generic
.baseclasses
import
BasicParser
from
nomadcore
.baseclasses
import
BasicParser
from
cp2kparser.generic.inputparsing
import
*
logger
=
logging
.
getLogger
(
"nomad"
)
...
...
parser/parser-cp2k/cp2kparser/versions/cp2k262/mainparser.py
View file @
68bf2b9c
import
re
from
nomadcore.simple_parser
import
SimpleMatcher
as
SM
from
nomadcore.caching_backend
import
CachingLevel
from
cp2kparser.generic
.baseclasses
import
MainParser
from
nomadcore
.baseclasses
import
Main
Hierarchical
Parser
from
inputparser
import
CP2KInputParser
import
numpy
as
np
import
logging
...
...
@@ -9,7 +9,7 @@ logger = logging.getLogger("nomad")
#===============================================================================
class
CP2KMainParser
(
MainParser
):
class
CP2KMainParser
(
Main
Hierarchical
Parser
):
"""The main parser class.
"""
def
__init__
(
self
,
file_path
,
parser_context
):
...
...
parser/parser-cp2k/cp2kparser/versions/versionsetup.py
View file @
68bf2b9c
"""Returns the
implementation
class
es
based on the given version identifier.
The
different version are grouped into subpackages.
"""Returns the
main parser
class based on the given version identifier.
The
different version are grouped into subpackages.
"""
import
importlib
import
logging
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
"nomad"
)
def
get_main_parser
(
version_id
):
...
...
parser/parser-cp2k/setup.py
View file @
68bf2b9c
...
...
@@ -13,7 +13,7 @@ def main():
version
=
"0.1"
,
include_package_data
=
True
,
package_data
=
{
''
:
[
'*.json'
,
'*.pickle'
],
''
:
[
'*.pickle'
],
},
description
=
"NoMaD parser implementation for CP2K"
,
author
=
"Lauri Himanen"
,
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment