QuasiharmonicParser.scala 1.75 KB
Newer Older
Hagen-Henrik Kowalski's avatar
Hagen-Henrik Kowalski 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
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 QhpParser extends SimpleExternalParserGenerator(
  name = "QhpParser",
  parserInfo = jn.JObject(
    ("name" -> jn.JString("QhpParser")) ::
      ("parserId" -> jn.JString("QhpParser" + lab.QhpVersionInfo.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.QhpVersionInfo.toMap.map {
            case (key, value) =>
              (key -> jn.JString(value.toString))
          }(breakOut): List[(String, jn.JString)])
      )) :: Nil
  ),
  mainFileTypes = Seq("text/.*"),
25
26
27
  mainFileRe = """# QHA 1\.0\s*
\s*
""".r,
Hagen-Henrik Kowalski's avatar
Hagen-Henrik Kowalski committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  cmd = Seq(DefaultPythonInterpreter.pythonExe(), "${envDir}/parsers/quasi-harmonic-properties/parser/parser-quasi-harmonic-properties/qhp.py", "${mainFileUri}", "${mainFilePath}"),
  resList = Seq(
    "parser-quasi-harmonic-properties/qhp.py",
    "parser-quasi-harmonic-properties/setup_paths.py",
    "nomad_meta_info/public.nomadmetainfo.json",
    "nomad_meta_info/common.nomadmetainfo.json",
    "nomad_meta_info/meta_types.nomadmetainfo.json",
    "nomad_meta_info/quasi-harmonic-properties.nomadmetainfo.json"
  ) ++ DefaultPythonInterpreter.commonFiles(),
  dirMap = Map(
    "parser-quasi-harmonic-properties" -> "parsers/quasi-harmonic-properties/parser/parser-quasi-harmonic-properties",
    "nomad_meta_info" -> "nomad-meta-info/meta_info/nomad_meta_info"
  ) ++ lab.DefaultPythonInterpreter.commonDirMapping(),
  metaInfoEnv = Some(lab.meta.KnownMetaInfoEnvs.qhp)
)