Commit 3160b36d authored by Mohamed, Fawzi Roberto (fawzi)'s avatar Mohamed, Fawzi Roberto (fawzi)
Browse files

scalariform

parent d31460b4
package eu.nomad_lab.parsers package eu.nomad_lab.parsers
import eu.{nomad_lab=>lab} import eu.{ nomad_lab => lab }
import eu.nomad_lab.DefaultPythonInterpreter import eu.nomad_lab.DefaultPythonInterpreter
import org.{json4s => jn} import org.{ json4s => jn }
import scala.collection.breakOut import scala.collection.breakOut
object GaussianParser extends SimpleExternalParserGenerator( object GaussianParser extends SimpleExternalParserGenerator(
name = "GaussianParser", name = "GaussianParser",
parserInfo = jn.JObject( parserInfo = jn.JObject(
("name" -> jn.JString("GaussianParser")) :: ("name" -> jn.JString("GaussianParser")) ::
("parserId" -> jn.JString("GaussianParser" + lab.GaussianVersionInfo.version)) :: ("parserId" -> jn.JString("GaussianParser" + lab.GaussianVersionInfo.version)) ::
("versionInfo" -> jn.JObject( ("versionInfo" -> jn.JObject(
("nomadCoreVersion" -> jn.JString(lab.NomadCoreVersionInfo.version)) :: ("nomadCoreVersion" -> jn.JString(lab.NomadCoreVersionInfo.version)) ::
(lab.GaussianVersionInfo.toMap.map{ case (key, value) => (lab.GaussianVersionInfo.toMap.map {
(key -> jn.JString(value.toString)) case (key, value) =>
}(breakOut): List[(String, jn.JString)]) (key -> jn.JString(value.toString))
)) :: Nil }(breakOut): List[(String, jn.JString)])
), )) :: Nil
mainFileTypes = Seq("text/.*"), ),
mainFileRe = """\s*Gaussian, Inc\. All Rights Reserved\.\s* mainFileTypes = Seq("text/.*"),
mainFileRe = """\s*Gaussian, Inc\. All Rights Reserved\.\s*
\s* \s*
\s*This is part of the Gaussian\(R\) [0-9]* program.""".r, \s*This is part of the Gaussian\(R\) [0-9]* program.""".r,
cmd = Seq(DefaultPythonInterpreter.python2Exe(), "${envDir}/parsers/gaussian/parser/parser-gaussian/parser_gaussian.py", cmd = Seq(DefaultPythonInterpreter.python2Exe(), "${envDir}/parsers/gaussian/parser/parser-gaussian/parser_gaussian.py",
"--uri", "${mainFileUri}", "${mainFilePath}"), "--uri", "${mainFileUri}", "${mainFilePath}"),
resList = Seq( resList = Seq(
"parser-gaussian/parser_gaussian.py", "parser-gaussian/parser_gaussian.py",
"parser-gaussian/setup_paths.py", "parser-gaussian/setup_paths.py",
"nomad_meta_info/common.nomadmetainfo.json", "nomad_meta_info/common.nomadmetainfo.json",
"nomad_meta_info/meta_types.nomadmetainfo.json", "nomad_meta_info/meta_types.nomadmetainfo.json",
"nomad_meta_info/gaussian.nomadmetainfo.json" "nomad_meta_info/gaussian.nomadmetainfo.json"
) ++ DefaultPythonInterpreter.commonFiles(), ) ++ DefaultPythonInterpreter.commonFiles(),
dirMap = Map( dirMap = Map(
"parser-gaussian" -> "parsers/gaussian/parser/parser-gaussian", "parser-gaussian" -> "parsers/gaussian/parser/parser-gaussian",
"nomad_meta_info" -> "nomad-meta-info/meta_info/nomad_meta_info", "nomad_meta_info" -> "nomad-meta-info/meta_info/nomad_meta_info",
"python" -> "python-common/common/python/nomadcore") ++ DefaultPythonInterpreter.commonDirMapping() "python" -> "python-common/common/python/nomadcore"
) ++ DefaultPythonInterpreter.commonDirMapping()
) )
package eu.nomad_lab.parsers package eu.nomad_lab.parsers
import eu.nomad_lab.{parsers, DefaultPythonInterpreter} import eu.nomad_lab.{ parsers, DefaultPythonInterpreter }
import org.scalacheck.Properties import org.scalacheck.Properties
import org.specs2.mutable.Specification import org.specs2.mutable.Specification
import org.{json4s => jn} import org.{ json4s => jn }
object GaussianParserSpec extends Specification { object GaussianParserSpec extends Specification {
"GaussianParserTest" >> { "GaussianParserTest" >> {
"test with Al.out">> { "test with Al.out" >> {
"test with json-events" >> { "test with json-events" >> {
ParserRun.parse(GaussianParser,"parsers/gaussian/test/examples/Al.out","json-events") must_== ParseResult.ParseSuccess ParserRun.parse(GaussianParser, "parsers/gaussian/test/examples/Al.out", "json-events") must_== ParseResult.ParseSuccess
} }
"test with json" >> { "test with json" >> {
ParserRun.parse(GaussianParser,"parsers/gaussian/test/examples/Al.out","json") must_== ParseResult.ParseSuccess ParserRun.parse(GaussianParser, "parsers/gaussian/test/examples/Al.out", "json") must_== ParseResult.ParseSuccess
} }
} }
} }
......
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