GaussianParser.scala 2.4 KB
Newer Older
1
/*
2 3 4 5 6 7 8 9 10 11 12 13 14
 * Copyright 2015-2018 Rosendo Valero, Fawzi Mohamed, Ankit Kariryaa, Rosendo Valero Montero
 * 
 *   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.
15
 */
16

ankit kariryaa's avatar
ankit kariryaa committed
17
package eu.nomad_lab.parsers
18

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

object GaussianParser extends SimpleExternalParserGenerator(
25 26 27 28 29
  name = "GaussianParser",
  parserInfo = jn.JObject(
    ("name" -> jn.JString("GaussianParser")) ::
      ("parserId" -> jn.JString("GaussianParser" + lab.GaussianVersionInfo.version)) ::
      ("versionInfo" -> jn.JObject(
30 31 32
        ("nomadCoreVersion" -> jn.JObject(lab.NomadCoreVersionInfo.toMap.map {
          case (k, v) => k -> jn.JString(v.toString)
        }(breakOut): List[(String, jn.JString)])) ::
33 34 35 36 37 38 39 40
          (lab.GaussianVersionInfo.toMap.map {
            case (key, value) =>
              (key -> jn.JString(value.toString))
          }(breakOut): List[(String, jn.JString)])
      )) :: Nil
  ),
  mainFileTypes = Seq("text/.*"),
  mainFileRe = """\s*Gaussian, Inc\.  All Rights Reserved\.\s*
41 42
\s*
\s*This is part of the Gaussian\(R\) [0-9]* program.""".r,
43
  cmd = Seq(DefaultPythonInterpreter.pythonExe(), "${envDir}/parsers/gaussian/parser/parser-gaussian/parser_gaussian.py",
44 45 46 47
    "--uri", "${mainFileUri}", "${mainFilePath}"),
  resList = Seq(
    "parser-gaussian/parser_gaussian.py",
    "parser-gaussian/setup_paths.py",
48
    "nomad_meta_info/public.nomadmetainfo.json",
49 50 51 52 53 54 55 56 57
    "nomad_meta_info/common.nomadmetainfo.json",
    "nomad_meta_info/meta_types.nomadmetainfo.json",
    "nomad_meta_info/gaussian.nomadmetainfo.json"
  ) ++ DefaultPythonInterpreter.commonFiles(),
  dirMap = Map(
    "parser-gaussian" -> "parsers/gaussian/parser/parser-gaussian",
    "nomad_meta_info" -> "nomad-meta-info/meta_info/nomad_meta_info",
    "python" -> "python-common/common/python/nomadcore"
  ) ++ DefaultPythonInterpreter.commonDirMapping()
ankit kariryaa's avatar
ankit kariryaa committed
58
)