Commit 7936bfae authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Added integration support (file scalainterface.py), modified tests to use...

Added integration support (file scalainterface.py), modified tests to use nomadtoolkit, started parsing more information to section_system_description.
parent 80587fd9
...@@ -28,7 +28,7 @@ class CP2KOutputParser262(object): ...@@ -28,7 +28,7 @@ class CP2KOutputParser262(object):
""" """
self.cp2kparser = cp2kparser self.cp2kparser = cp2kparser
self.metainfos = metainfos self.metainfos = metainfos
self.f_regex = "-?\d+\.\d+(E+|-\d+)?" self.f_regex = "-?\d+\.\d+(E+|-\d+)?" # Regex for a floating point value
# Define the output parsing tree for this version # Define the output parsing tree for this version
self.outputstructure = SM( self.outputstructure = SM(
...@@ -84,6 +84,15 @@ class CP2KOutputParser262(object): ...@@ -84,6 +84,15 @@ class CP2KOutputParser262(object):
) )
] ]
), ),
# SM(
# startReStr=" MODULE QUICKSTEP: ATOMIC COORDINATES IN angstrom",
# subMatchers=[
# SM(
# repeats=True,
# startReStr="\s+\d+\s+\d+\s+(?P<cp2k_atom_label>\w+)\s+\d+\s+{}\s+{}\s+{}".format(self.f_regex)
# )
# ]
# )
SM( SM(
startReStr=" TOTAL NUMBERS AND MAXIMUM NUMBERS", startReStr=" TOTAL NUMBERS AND MAXIMUM NUMBERS",
sections=["cp2k_section_numbers"], sections=["cp2k_section_numbers"],
......
...@@ -3,6 +3,7 @@ This is the access point to the parser for the scala layer in the nomad project. ...@@ -3,6 +3,7 @@ This is the access point to the parser for the scala layer in the nomad project.
""" """
import os import os
from cp2kparser import CP2KParser from cp2kparser import CP2KParser
from cp2kparser.parsing.outputparsing import CP2KOutputParser262
from nomadcore.local_meta_info import loadJsonFile, InfoKindEl from nomadcore.local_meta_info import loadJsonFile, InfoKindEl
from nomadcore.simple_parser import mainFunction from nomadcore.simple_parser import mainFunction
...@@ -11,10 +12,11 @@ from nomadcore.simple_parser import mainFunction ...@@ -11,10 +12,11 @@ from nomadcore.simple_parser import mainFunction
# auxiliary files. Also the version identification is skipped and the structure # auxiliary files. Also the version identification is skipped and the structure
# used in CP2K 2.6.2 is assumed. # used in CP2K 2.6.2 is assumed.
if __name__ == "__main__": if __name__ == "__main__":
cp2kparser = CP2KParser() cp2kparser = CP2KParser()
# Get the outputparser class # Get the outputparser class
outputparser = globals()["CP2KOutputParser{}".format("262")](None, None) outputparser = globals()["CP2KOutputParser262"](None, None)
# Setup the metainfos # Setup the metainfos
metaInfoPath = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../../../nomad-meta-info/meta_info/nomad_meta_info/{}".format(cp2kparser.get_metainfo_filename()))) metaInfoPath = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../../../nomad-meta-info/meta_info/nomad_meta_info/{}".format(cp2kparser.get_metainfo_filename())))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment