BigDFTParser.scala 4.42 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.
 */
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package eu.nomad_lab.parsers

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

object BigDFTParser extends SimpleExternalParserGenerator(
  name = "BigDFTParser",
  parserInfo = jn.JObject(
    ("name" -> jn.JString("BigDFTParser")) ::
      ("parserId" -> jn.JString("BigDFTParser" + lab.BigdftVersionInfo.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.BigdftVersionInfo.toMap.map {
            case (key, value) =>
              (key -> jn.JString(value.toString))
          }(breakOut): List[(String, jn.JString)])
      )) :: Nil
  ),
  mainFileTypes = Seq("text/.*"),
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
  mainFileRe = """__________________________________ A fast and precise DFT wavelet code\s*
   \|     \|     \|     \|     \|     \|\s*
   \|     \|     \|     \|     \|     \|      BBBB         i       gggggg\s*
   \|_____\|_____\|_____\|_____\|_____\|     B    B               g\s*
   \|     \|  :  \|  :  \|     \|     \|    B     B        i     g\s*
   \|     \|-0\+--\|-0\+--\|     \|     \|    B    B         i     g        g\s*
   \|_____\|__:__\|__:__\|_____\|_____\|___ BBBBB          i     g         g\s*
   \|  :  \|     \|     \|  :  \|     \|    B    B         i     g         g\s*
   \|--\+0-\|     \|     \|-0\+--\|     \|    B     B     iiii     g         g\s*
   \|__:__\|_____\|_____\|__:__\|_____\|    B     B        i      g        g\s*
   \|     \|  :  \|  :  \|     \|     \|    B BBBB        i        g      g\s*
   \|     \|-0\+--\|-0\+--\|     \|     \|    B        iiiii          gggggg\s*
   \|_____\|__:__\|__:__\|_____\|_____\|__BBBBB\s*
   \|     \|     \|     \|  :  \|     \|                           TTTTTTTTT\s*
   \|     \|     \|     \|--\+0-\|     \|  DDDDDD          FFFFF        T\s*
   \|_____\|_____\|_____\|__:__\|_____\| D      D        F        TTTT T\s*
   \|     \|     \|     \|  :  \|     \|D        D      F        T     T\s*
   \|     \|     \|     \|--\+0-\|     \|D         D     FFFF     T     T\s*
   \|_____\|_____\|_____\|__:__\|_____\|D___      D     F         T    T\s*
   \|     \|     \|  :  \|     \|     \|D         D     F          TTTTT\s*
   \|     \|     \|--\+0-\|     \|     \| D        D     F         T    T\s*
   \|_____\|_____\|__:__\|_____\|_____\|          D     F        T     T\s*
   \|     \|     \|     \|     \|     \|         D               T    T\s*
   \|     \|     \|     \|     \|     \|   DDDDDD       F         TTTT\s*
63
   \|_____\|_____\|_____\|_____\|_____\|______                    www\.bigdft\.org""".r,
64
  cmd = Seq(DefaultPythonInterpreter.pythonExe(), "${envDir}/parsers/big-dft/parser/parser-big-dft/bigdftparser/scalainterface.py",
65
66
67
68
69
70
71
72
    "${mainFilePath}"),
  cmdCwd = "${mainFilePath}/..",
  resList = Seq(
    "parser-big-dft/bigdftparser/__init__.py",
    "parser-big-dft/bigdftparser/setup_paths.py",
    "parser-big-dft/bigdftparser/parser.py",
    "parser-big-dft/bigdftparser/scalainterface.py",
    "parser-big-dft/bigdftparser/versions/__init__.py",
Lauri Himanen's avatar
Lauri Himanen committed
73
74
    "parser-big-dft/bigdftparser/versions/bigdft18/__init__.py",
    "parser-big-dft/bigdftparser/versions/bigdft18/mainparser.py",
75
76
    "parser-big-dft/bigdftparser/generic/__init__.py",
    "parser-big-dft/bigdftparser/generic/libxc_codes.py",
77
78
79
80
81
82
83
84
85
86
    "nomad_meta_info/public.nomadmetainfo.json",
    "nomad_meta_info/common.nomadmetainfo.json",
    "nomad_meta_info/meta_types.nomadmetainfo.json",
    "nomad_meta_info/big_dft.nomadmetainfo.json"
  ) ++ DefaultPythonInterpreter.commonFiles(),
  dirMap = Map(
    "parser-big-dft" -> "parsers/big-dft/parser/parser-big-dft",
    "nomad_meta_info" -> "nomad-meta-info/meta_info/nomad_meta_info"
  ) ++ DefaultPythonInterpreter.commonDirMapping()
)