Commit 66f3f805 authored by Mikkel Strange's avatar Mikkel Strange
Browse files

for new aff fileformat

parent 832bffea
package eu.nomad_lab.parsers
import eu.{ nomad_lab => lab }
import org.{ json4s => jn }
import scala.collection.breakOut
object GpawParser2 extends SimpleExternalParserGenerator(
name = "GpawParser2",
parserInfo = jn.JObject(
("name" -> jn.JString("GpawParser2")) ::
("parserId" -> jn.JString("GpawParser2" + lab.GpawVersionInfo.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.GpawVersionInfo.toMap.map {
case (key, value) =>
(key -> jn.JString(value.toString))
}(breakOut): List[(String, jn.JString)])
)) :: Nil
),
mainFileTypes = Seq("application/x-bin"),
mainFileRe = "".r,
cmd = Seq(lab.DefaultPythonInterpreter.pythonExe(), "${envDir}/parsers/gpaw/parser/parser-gpaw/parser2.py",
"${mainFilePath}"),
resList = Seq(
"parser-gpaw/parser2.py",
"parser-gpaw/default_parameters.py",
"parser-gpaw/libxc_names.py",
"parser-gpaw/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/gpaw.nomadmetainfo.json"
) ++ lab.DefaultPythonInterpreter.commonFiles(),
dirMap = Map(
"parser-gpaw" -> "parsers/gpaw/parser/parser-gpaw",
"nomad_meta_info" -> "nomad-meta-info/meta_info/nomad_meta_info"
) ++ lab.DefaultPythonInterpreter.commonDirMapping()
) {
override def isMainFile(filePath: String, bytePrefix: Array[Byte], stringPrefix: Option[String]): Option[ParserMatch] = {
if (filePath.endsWith(".gpw"))
Some(ParserMatch(mainFileMatchPriority, mainFileMatchWeak))
else
None
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment