GaussianParser.scala 1.74 KB
Newer Older
ankit kariryaa's avatar
ankit kariryaa committed
1
package eu.nomad_lab.parsers
2

Mohamed, Fawzi Roberto (fawzi)'s avatar
Mohamed, Fawzi Roberto (fawzi) committed
3
import eu.{ nomad_lab => lab }
ankit kariryaa's avatar
ankit kariryaa committed
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
ankit kariryaa's avatar
ankit kariryaa committed
7
8

object GaussianParser extends SimpleExternalParserGenerator(
Mohamed, Fawzi Roberto (fawzi)'s avatar
Mohamed, Fawzi Roberto (fawzi) committed
9
10
11
12
13
  name = "GaussianParser",
  parserInfo = jn.JObject(
    ("name" -> jn.JString("GaussianParser")) ::
      ("parserId" -> jn.JString("GaussianParser" + lab.GaussianVersionInfo.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
20
21
22
23
24
          (lab.GaussianVersionInfo.toMap.map {
            case (key, value) =>
              (key -> jn.JString(value.toString))
          }(breakOut): List[(String, jn.JString)])
      )) :: Nil
  ),
  mainFileTypes = Seq("text/.*"),
  mainFileRe = """\s*Gaussian, Inc\.  All Rights Reserved\.\s*
25
26
\s*
\s*This is part of the Gaussian\(R\) [0-9]* program.""".r,
Mohamed, Fawzi Roberto (fawzi)'s avatar
Mohamed, Fawzi Roberto (fawzi) committed
27
28
29
30
31
  cmd = Seq(DefaultPythonInterpreter.python2Exe(), "${envDir}/parsers/gaussian/parser/parser-gaussian/parser_gaussian.py",
    "--uri", "${mainFileUri}", "${mainFilePath}"),
  resList = Seq(
    "parser-gaussian/parser_gaussian.py",
    "parser-gaussian/setup_paths.py",
32
    "nomad_meta_info/public.nomadmetainfo.json",
Mohamed, Fawzi Roberto (fawzi)'s avatar
Mohamed, Fawzi Roberto (fawzi) committed
33
34
35
36
37
38
39
40
41
    "nomad_meta_info/common.nomadmetainfo.json",
    "nomad_meta_info/meta_types.nomadmetainfo.json",
    "nomad_meta_info/gaussian.nomadmetainfo.json"
  ) ++ DefaultPythonInterpreter.commonFiles(),
  dirMap = Map(
    "parser-gaussian" -> "parsers/gaussian/parser/parser-gaussian",
    "nomad_meta_info" -> "nomad-meta-info/meta_info/nomad_meta_info",
    "python" -> "python-common/common/python/nomadcore"
  ) ++ DefaultPythonInterpreter.commonDirMapping()
ankit kariryaa's avatar
ankit kariryaa committed
42
)