From d9ca950a75ceb9ede6b06f848876a909daecbf83 Mon Sep 17 00:00:00 2001 From: Lauri Himanen <lauri.himanen@aalto.fi> Date: Thu, 29 Jun 2017 23:10:13 +0300 Subject: [PATCH] Added a function for getting the regex that is used to match the main file, added a dependency. --- parser/parser-cp2k/cp2kparser/parser.py | 11 +++++++++++ setup.py | 1 + 2 files changed, 12 insertions(+) diff --git a/parser/parser-cp2k/cp2kparser/parser.py b/parser/parser-cp2k/cp2kparser/parser.py index c827ce6..1e5d089 100644 --- a/parser/parser-cp2k/cp2kparser/parser.py +++ b/parser/parser-cp2k/cp2kparser/parser.py @@ -60,6 +60,17 @@ class CP2KParser(ParserInterface): # for the version is found, use the main parser for CP2K 2.6.2 self.setup_main_parser({"version_id": version_id, "run_type": run_type}) + @staticmethod + def get_mainfile_regex(): + regex_str = ( + " \*\*\*\* \*\*\*\* \*\*\*\*\*\* \*\* PROGRAM STARTED AT\s.*\n" + " \*\*\*\*\* \*\* \*\*\* \*\*\* \*\* PROGRAM STARTED ON\s*.*\n" + " \*\* \*\*\*\* \*\*\*\*\*\* PROGRAM STARTED BY .*\n" + " \*\*\*\*\* \*\* \*\* \*\* \*\* PROGRAM PROCESS ID .*\n" + " \*\*\*\* \*\* \*\*\*\*\*\*\* \*\* PROGRAM STARTED IN .*\n" + ) + return regex_str + def get_metainfo_filename(self): return "cp2k.nomadmetainfo.json" diff --git a/setup.py b/setup.py index 6c2804b..928bb88 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,7 @@ def main(): package_dir={'': 'parser/parser-cp2k'}, packages=find_packages(), install_requires=[ + 'future', 'pint', 'numpy', 'mdtraj', -- GitLab