Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
parser-lib-atoms
Commits
6f066b21
Commit
6f066b21
authored
Jul 14, 2016
by
Carl Poelking
Browse files
libAtoms init.
parent
0123a27c
Changes
7
Hide whitespace changes
Inline
Side-by-side
parser/parser-lib-atoms/libAtomsParser.py
0 → 100644
View file @
6f066b21
parser/parser-lib-atoms/libLibAtomsParser.py
0 → 100644
View file @
6f066b21
parser/parser-lib-atoms/libMomo.py
0 → 100644
View file @
6f066b21
parser/parser-lib-atoms/setup_paths.py
0 → 100644
View file @
6f066b21
import
sys
,
os
,
os
.
path
baseDir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
commonDir
=
os
.
path
.
normpath
(
os
.
path
.
join
(
baseDir
,
"../../../../python-common/common/python"
))
if
not
commonDir
in
sys
.
path
:
sys
.
path
.
insert
(
0
,
commonDir
)
src/main/scala/eu/nomad_lab/parsers/LibAtomsParser.scala
0 → 100644
View file @
6f066b21
package
eu.nomad_lab.parsers
import
eu.
{
nomad_lab
=>
lab
}
import
eu.nomad_lab.DefaultPythonInterpreter
import
org.
{
json4s
=>
jn
}
import
scala.collection.breakOut
object
LibAtomsParser
extends
SimpleExternalParserGenerator
(
name
=
"LibAtomsParser"
,
parserInfo
=
jn
.
JObject
(
(
"name"
->
jn
.
JString
(
"LibAtomsParser"
))
::
(
"parserId"
->
jn
.
JString
(
"LibAtomsParser"
+
lab
.
LibAtomsVersionInfo
.
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
.
LibAtomsVersionInfo
.
toMap
.
map
{
case
(
key
,
value
)
=>
(
key
->
jn
.
JString
(
value
.
toString
))
}(
breakOut
)
:
List
[(
String
,
jn.JString
)])
))
::
Nil
),
mainFileTypes
=
Seq
(
"text/.*"
),
mainFileRe
=
""" ???? """
.
r
,
cmd
=
Seq
(
DefaultPythonInterpreter
.
pythonExe
(),
"${envDir}/parsers/lib-atoms/parser/parser-lib-atoms/libAtomsParser.py"
,
"${mainFilePath}"
),
resList
=
Seq
(
"parser-lib-atoms/libAtomsParser.py"
,
"parser-lib-atoms/libLibAtomsParser.py"
,
"parser-lib-atoms/libMomo.py"
,
"parser-lib-atoms/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/lib_atoms.nomadmetainfo.json"
)
++
DefaultPythonInterpreter
.
commonFiles
(),
dirMap
=
Map
(
"parser-lib-atoms"
->
"parsers/lib-atoms/parser/parser-lib-atoms"
,
"nomad_meta_info"
->
"nomad-meta-info/meta_info/nomad_meta_info"
)
++
DefaultPythonInterpreter
.
commonDirMapping
()
)
src/test/scala/eu/nomad_lab/parsers/LibAtomsParserSpec.scala
0 → 100644
View file @
6f066b21
package
eu.nomad_lab.parsers
import
org.specs2.mutable.Specification
object
LibAtomsParserSpec
extends
Specification
{
"LibAtomsParserTest"
>>
{
"test with json-events"
>>
{
ParserRun
.
parse
(
LibAtomsParser
,
"parsers/lib-atoms/test/lib-atoms-tungsten/tungsten_gap_6.xyz"
,
"json-events"
)
must_==
ParseResult
.
ParseSuccess
}
"test with json"
>>
{
ParserRun
.
parse
(
LibAtomsParser
,
"parsers/lib-atoms/test/lib-atoms-tungsten/tungsten_gap_6.xyz"
,
"json"
)
must_==
ParseResult
.
ParseSuccess
}
}
}
test/lib-atoms-tungsten/tungsten_gap_6.xyz
0 → 100644
View file @
6f066b21
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment