OctopusParser.scala 2.1 KB
Newer Older
ankit kariryaa's avatar
ankit kariryaa committed
1
2
3
4
5
6
package eu.nomad_lab.parsers

import eu.{ nomad_lab => lab }
import eu.nomad_lab.DefaultPythonInterpreter
import org.{ json4s => jn }
import scala.collection.breakOut
7
8
import eu.nomad_lab.parsers.AncillaryFilesPrefilter.{ ParentSubtree => ParentSubtree }
import eu.nomad_lab.parsers.AncillaryFilesPrefilter.{ WholeUpload => WholeUpload }
ankit kariryaa's avatar
ankit kariryaa committed
9
10

object OctopusParser extends SimpleExternalParserGenerator(
11
  name = "OctopusParser",
ankit kariryaa's avatar
ankit kariryaa committed
12
  parserInfo = jn.JObject(
13
14
    ("name" -> jn.JString("OctopusParser")) ::
      ("parserId" -> jn.JString("OctopusParser" + lab.OctopusVersionInfo.version)) ::
ankit kariryaa's avatar
ankit kariryaa committed
15
16
17
18
19
20
21
22
23
24
25
26
      ("versionInfo" -> jn.JObject(
        ("nomadCoreVersion" -> jn.JObject(lab.NomadCoreVersionInfo.toMap.map {
          case (k, v) => k -> jn.JString(v.toString)
        }(breakOut): List[(String, jn.JString)])) ::
          (lab.OctopusVersionInfo.toMap.map {
            case (key, value) =>
              (key -> jn.JString(value.toString))
          }(breakOut): List[(String, jn.JString)])
      )) :: Nil
  ),
  mainFileTypes = Seq("text/.*"),
  //TODO: Update the replacement string (mainFileRe)
27
28
29
  mainFileRe = """\*{32} Grid \*{32}
Simulation Box:
""".r,
30
  cmd = Seq(DefaultPythonInterpreter.pythonExe(), "${envDir}/parsers/octopus/parser/parser-octopus/parser_octopus.py",
31
    "${mainFilePath}"),
32
  ancillaryFilesPrefilter = ParentSubtree,
ankit kariryaa's avatar
ankit kariryaa committed
33
  resList = Seq(
34
    "parser-octopus/parser_octopus.py",
35
    "parser-octopus/aseoct.py",
36
37
38
39
    "parser-octopus/octopus_logfile_parser.py",
    "parser-octopus/generate-octopus-json.py",
    "parser-octopus/util.py",
    "parser-octopus/octopus_info_parser.py",
ankit kariryaa's avatar
ankit kariryaa committed
40
41
42
43
    "parser-octopus/setup_paths.py",
    "nomad_meta_info/public.nomadmetainfo.json",
    "nomad_meta_info/common.nomadmetainfo.json",
    "nomad_meta_info/meta_types.nomadmetainfo.json",
44
    "nomad_meta_info/octopus.autogenerated.nomadmetainfo.json",
ankit kariryaa's avatar
ankit kariryaa committed
45
46
47
48
49
50
51
    "nomad_meta_info/octopus.nomadmetainfo.json"
  ) ++ DefaultPythonInterpreter.commonFiles(),
  dirMap = Map(
    "parser-octopus" -> "parsers/octopus/parser/parser-octopus",
    "nomad_meta_info" -> "nomad-meta-info/meta_info/nomad_meta_info"
  ) ++ DefaultPythonInterpreter.commonDirMapping()
)