GromosParser.scala 1.75 KB
Newer Older
Berk Onat's avatar
Berk Onat committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package eu.nomad_lab.parsers

import eu.nomad_lab
import eu.nomad_lab.DefaultPythonInterpreter
import org.{ json4s => jn }
import eu.{ nomad_lab => lab }
import scala.collection.breakOut

object GromosParser extends SimpleExternalParserGenerator(
  name = "GromosParser",
  parserInfo = jn.JObject(
    ("name" -> jn.JString("GromosParser")) ::
      ("parserId" -> jn.JString("GromosParser" + lab.GromosVersionInfo.version)) ::
      ("versionInfo" -> jn.JObject(
        ("nomadCoreVersion" -> jn.JObject(lab.NomadCoreVersionInfo.toMap.map {
          case (k, v) => k -> jn.JString(v.toString)
        }(breakOut): List[(String, jn.JString)])) ::
          (lab.GromosVersionInfo.toMap.map {
            case (key, value) =>
              (key -> jn.JString(value.toString))
          }(breakOut): List[(String, jn.JString)])
      )) :: Nil
  ),
  mainFileTypes = Seq("text/.*"),
  mainFileRe = """^MD\+\+\s*\s*""".r,
  cmd = Seq(DefaultPythonInterpreter.pythonExe(), "${envDir}/parsers/gromos/parser/parser-gromos/GROMOSParser.py",
    "${mainFilePath}"),
  resList = Seq(
    "parser-gromos/GROMOSParser.py",
    "parser-gromos/GROMOSDictionary.py",
    "parser-gromos/GROMOSCommon.py",
    "parser-gromos/setup_paths.py",
    "nomad_meta_info/public.nomadmetainfo.json",
    "nomad_meta_info/common.nomadmetainfo.json",
    "nomad_meta_info/meta_types.nomadmetainfo.json"
36
    "nomad_meta_info/gromos.nomadmetainfo.json"
Berk Onat's avatar
Berk Onat committed
37
38
39
40
41
42
43
44
45
  ) ++ DefaultPythonInterpreter.commonFiles(),
  dirMap = Map(
    "parser-gromos" -> "parsers/gromos/parser/parser-gromos",
    "nomad_meta_info" -> "nomad-meta-info/meta_info/nomad_meta_info",
    "python" -> "python-common/common/python/nomadcore"
  ) ++ DefaultPythonInterpreter.commonDirMapping(),
  metaInfoEnv = Some(lab.meta.KnownMetaInfoEnvs.gromos)
)