ExcitingParser.scala 2.72 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
   Copyright 2016-2017 The NOMAD Developers Group

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */
ankit kariryaa's avatar
ankit kariryaa committed
16
package eu.nomad_lab.parsers
17

ankit kariryaa's avatar
ankit kariryaa committed
18
import eu.{ nomad_lab => lab }
ankit kariryaa's avatar
ankit kariryaa committed
19
import eu.nomad_lab.DefaultPythonInterpreter
ankit kariryaa's avatar
ankit kariryaa committed
20
import org.{ json4s => jn }
21
22
import scala.collection.breakOut

ankit kariryaa's avatar
ankit kariryaa committed
23
24
25
26
object ExcitingParser extends SimpleExternalParserGenerator(
  name = "ExcitingParser",
  parserInfo = jn.JObject(
    ("name" -> jn.JString("ExcitingParser")) ::
27
28
      ("parserId" -> jn.JString("ExcitingParser" + lab.ExcitingVersionInfo.version)) ::
      ("versionInfo" -> jn.JObject(
29
30
31
        ("nomadCoreVersion" -> jn.JObject(lab.NomadCoreVersionInfo.toMap.map {
          case (k, v) => k -> jn.JString(v.toString)
        }(breakOut): List[(String, jn.JString)])) ::
ankit kariryaa's avatar
ankit kariryaa committed
32
33
34
          (lab.ExcitingVersionInfo.toMap.map {
            case (key, value) =>
              (key -> jn.JString(value.toString))
35
36
37
          }(breakOut): List[(String, jn.JString)])
      )) :: Nil
  ),
ankit kariryaa's avatar
ankit kariryaa committed
38
  mainFileTypes = Seq("text/.*"),
39
40
41
  mainFileRe = """\s*=================================================+\s*
\s*\|\s*EXCITING\s(?<version>\S*) started\s*=
(?:\s*\|\sversion hash id:\s*(?<hashId>\S*)\s*=)?""".r,
42
  cmd = Seq(DefaultPythonInterpreter.pythonExe(), "${envDir}/parsers/exciting/parser/parser-exciting/parser_exciting.py",
ankit kariryaa's avatar
ankit kariryaa committed
43
44
45
    "--uri", "${mainFileUri}", "${mainFilePath}"),
  resList = Seq(
    "parser-exciting/parser_exciting.py",
46
    "parser-exciting/exciting_parser_dos.py",
47
    "parser-exciting/exciting_parser_bandstructure.py",
48
    "parser-exciting/exciting_parser_gw.py",
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
49
    "parser-exciting/exciting_parser_input.py",
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
50
    "parser-exciting/exciting_parser_GS_input.py",
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
51
    "parser-exciting/exciting_parser_XS_input.py",
Pardini, Lorenzo (lopa)'s avatar
Pardini, Lorenzo (lopa) committed
52
    "parser-exciting/exciting_parser_xs.py",
ankit kariryaa's avatar
ankit kariryaa committed
53
    "parser-exciting/setup_paths.py",
54
    "nomad_meta_info/public.nomadmetainfo.json",
ankit kariryaa's avatar
ankit kariryaa committed
55
56
57
58
59
60
61
    "nomad_meta_info/common.nomadmetainfo.json",
    "nomad_meta_info/meta_types.nomadmetainfo.json",
    "nomad_meta_info/exciting.nomadmetainfo.json"
  ) ++ DefaultPythonInterpreter.commonFiles(),
  dirMap = Map(
    "parser-exciting" -> "parsers/exciting/parser/parser-exciting/",
    "nomad_meta_info" -> "nomad-meta-info/meta_info/nomad_meta_info",
ankit kariryaa's avatar
ankit kariryaa committed
62
63
    "python" -> "python-common/common/python/nomadcore"
  ) ++ DefaultPythonInterpreter.commonDirMapping()
ankit kariryaa's avatar
ankit kariryaa committed
64
)