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

scalariform

parent 64870722
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 Cp2kParser extends SimpleExternalParserGenerator( object Cp2kParser extends SimpleExternalParserGenerator(
...@@ -12,8 +12,9 @@ object Cp2kParser extends SimpleExternalParserGenerator( ...@@ -12,8 +12,9 @@ object Cp2kParser extends SimpleExternalParserGenerator(
("parserId" -> jn.JString("Cp2kParser" + lab.Cp2kVersionInfo.version)) :: ("parserId" -> jn.JString("Cp2kParser" + lab.Cp2kVersionInfo.version)) ::
("versionInfo" -> jn.JObject( ("versionInfo" -> jn.JObject(
("nomadCoreVersion" -> jn.JString(lab.NomadCoreVersionInfo.version)) :: ("nomadCoreVersion" -> jn.JString(lab.NomadCoreVersionInfo.version)) ::
(lab.Cp2kVersionInfo.toMap.map{ case (key, value) => (lab.Cp2kVersionInfo.toMap.map {
(key -> jn.JString(value.toString)) case (key, value) =>
(key -> jn.JString(value.toString))
}(breakOut): List[(String, jn.JString)]) }(breakOut): List[(String, jn.JString)])
)) :: Nil )) :: Nil
), ),
...@@ -57,5 +58,6 @@ object Cp2kParser extends SimpleExternalParserGenerator( ...@@ -57,5 +58,6 @@ object Cp2kParser extends SimpleExternalParserGenerator(
) ++ DefaultPythonInterpreter.commonFiles(), ) ++ DefaultPythonInterpreter.commonFiles(),
dirMap = Map( dirMap = Map(
"parser-cp2k" -> "parsers/cp2k/parser/parser-cp2k", "parser-cp2k" -> "parsers/cp2k/parser/parser-cp2k",
"nomad_meta_info" -> "nomad-meta-info/meta_info/nomad_meta_info") ++ DefaultPythonInterpreter.commonDirMapping() "nomad_meta_info" -> "nomad-meta-info/meta_info/nomad_meta_info"
) ++ DefaultPythonInterpreter.commonDirMapping()
) )
...@@ -2,16 +2,14 @@ package eu.nomad_lab.parsers ...@@ -2,16 +2,14 @@ package eu.nomad_lab.parsers
import org.specs2.mutable.Specification import org.specs2.mutable.Specification
object Cp2kParserSpec extends Specification { object Cp2kParserSpec extends Specification {
"Cp2kParserTest" >> { "Cp2kParserTest" >> {
"test with json-events" >> { "test with json-events" >> {
ParserRun.parse(Cp2kParser,"parsers/cp2k/test/examples/Si_bulk8/Si_bulk8.out","json-events") must_== ParseResult.ParseSuccess ParserRun.parse(Cp2kParser, "parsers/cp2k/test/examples/Si_bulk8/Si_bulk8.out", "json-events") must_== ParseResult.ParseSuccess
} }
} }
"test with json" >> { "test with json" >> {
ParserRun.parse(Cp2kParser,"parsers/cp2k/test/examples/Si_bulk8/Si_bulk8.out","json") must_== ParseResult.ParseSuccess ParserRun.parse(Cp2kParser, "parsers/cp2k/test/examples/Si_bulk8/Si_bulk8.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