Cp2kParser.scala 2.92 KB
Newer Older
1
package eu.nomad_lab.parsers
2

Mohamed, Fawzi Roberto (fawzi)'s avatar
Mohamed, Fawzi Roberto (fawzi) committed
3
import eu.{ nomad_lab => lab }
4
import eu.nomad_lab.DefaultPythonInterpreter
Mohamed, Fawzi Roberto (fawzi)'s avatar
Mohamed, Fawzi Roberto (fawzi) committed
5
import org.{ json4s => jn }
6
import scala.collection.breakOut
7
8
9
10
11

object Cp2kParser extends SimpleExternalParserGenerator(
  name = "Cp2kParser",
  parserInfo = jn.JObject(
    ("name" -> jn.JString("Cp2kParser")) ::
12
13
      ("parserId" -> jn.JString("Cp2kParser" + lab.Cp2kVersionInfo.version)) ::
      ("versionInfo" -> jn.JObject(
14
15
16
        ("nomadCoreVersion" -> jn.JObject(lab.NomadCoreVersionInfo.toMap.map {
          case (k, v) => k -> jn.JString(v.toString)
        }(breakOut): List[(String, jn.JString)])) ::
Mohamed, Fawzi Roberto (fawzi)'s avatar
Mohamed, Fawzi Roberto (fawzi) committed
17
18
19
          (lab.Cp2kVersionInfo.toMap.map {
            case (key, value) =>
              (key -> jn.JString(value.toString))
20
21
22
          }(breakOut): List[(String, jn.JString)])
      )) :: Nil
  ),
23
24
25
26
27
28
29
30
31
32
33
34
  mainFileTypes = Seq("text/.*"),
  mainFileRe = """  \*\*\*\* \*\*\*\* \*\*\*\*\*\*  \*\*  PROGRAM STARTED AT\s(?<cp2kStartedAt>.*)
 \*\*\*\*\* \*\* \*\*\*  \*\*\* \*\*   PROGRAM STARTED ON\s*.*
 \*\*    \*\*\*\*   \*\*\*\*\*\*    PROGRAM STARTED BY .*
 \*\*\*\*\* \*\*    \*\* \*\* \*\*   PROGRAM PROCESS ID .*
  \*\*\*\* \*\*  \*\*\*\*\*\*\*  \*\*  PROGRAM STARTED IN .*
(?:\s*\n|                                      \s+.*
)*
(?:\s*CP2K\| version string:\s*(?<cp2kVersionString>.*)
)?(?:\s*CP2K\| source code revision number:\s*(?<cp2kRevision>.*)
)?""".r,
  cmd = Seq(DefaultPythonInterpreter.python2Exe(), "${envDir}/parsers/cp2k/parser/parser-cp2k/cp2kparser/scalainterface.py",
35
    "${mainFilePath}"),
36
37
  cmdCwd = "${mainFilePath}/..",
  resList = Seq(
38
    "parser-cp2k/cp2kparser/__init__.py",
39
40
41
42
    "parser-cp2k/cp2kparser/setup_paths.py",
    "parser-cp2k/cp2kparser/parser.py",
    "parser-cp2k/cp2kparser/generic/__init__.py",
    "parser-cp2k/cp2kparser/generic/inputparsing.py",
Lauri Himanen's avatar
Lauri Himanen committed
43
    "parser-cp2k/cp2kparser/generic/configurationreading.py",
44
    "parser-cp2k/cp2kparser/generic/csvparsing.py",
45
46
47
    "parser-cp2k/cp2kparser/versions/__init__.py",
    "parser-cp2k/cp2kparser/versions/versionsetup.py",
    "parser-cp2k/cp2kparser/versions/cp2k262/__init__.py",
48
    "parser-cp2k/cp2kparser/versions/cp2k262/singlepointparser.py",
49
    "parser-cp2k/cp2kparser/versions/cp2k262/geooptparser.py",
50
    "parser-cp2k/cp2kparser/versions/cp2k262/singlepointforceparser.py",
Lauri Himanen's avatar
Lauri Himanen committed
51
    "parser-cp2k/cp2kparser/versions/cp2k262/inputparser.py",
52
    "parser-cp2k/cp2kparser/versions/cp2k262/commonmatcher.py",
53
    "parser-cp2k/cp2kparser/versions/cp2k262/input_data/cp2k_input_tree.pickle",
54
    "parser-cp2k/cp2kparser/scalainterface.py",
55
    "nomad_meta_info/public.nomadmetainfo.json",
56
57
58
59
60
61
    "nomad_meta_info/common.nomadmetainfo.json",
    "nomad_meta_info/meta_types.nomadmetainfo.json",
    "nomad_meta_info/cp2k.nomadmetainfo.json"
  ) ++ DefaultPythonInterpreter.commonFiles(),
  dirMap = Map(
    "parser-cp2k" -> "parsers/cp2k/parser/parser-cp2k",
Mohamed, Fawzi Roberto (fawzi)'s avatar
Mohamed, Fawzi Roberto (fawzi) committed
62
63
    "nomad_meta_info" -> "nomad-meta-info/meta_info/nomad_meta_info"
  ) ++ DefaultPythonInterpreter.commonDirMapping()
64
)