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
Markus Scheidgen
parser-exciting
Commits
5c8c21d4
Commit
5c8c21d4
authored
Dec 16, 2015
by
Mohamed, Fawzi Roberto (fawzi)
Browse files
first commit: parsing skeleton based on simple_parser
parents
Changes
5
Show whitespace changes
Inline
Side-by-side
.gitignore
0 → 100644
View file @
5c8c21d4
# use glob syntax.
syntax: glob
*.ser
*.class
*~
*.bak
#*.off
*.old
*.pyc
*.bk
*.swp
.DS_Store
# logging files
detailed.log
# eclipse conf file
.settings
.classpath
.project
.manager
.scala_dependencies
# idea
.idea
*.iml
# building
target
build
null
tmp*
temp*
dist
test-output
build.log
# other scm
.svn
.CVS
.hg*
# switch to regexp syntax.
# syntax: regexp
# ^\.pc/
#SHITTY output not in target directory
build.log
#emacs TAGS
TAGS
lib/
env/
README.md
0 → 100644
View file @
5c8c21d4
# Exciting Parser
This is the parser for the
[
exciting
](
http://exciting-code.org/
)
part of the
[
NOMAD Laboratory
](
http://nomad-lab.eu
)
. The official version lives at
git@gitlab.mpcdf.mpg.de:nomad-lab/parser-exciting.git
you can browse it at
https://gitlab.mpcdf.mpg.de/nomad-lab/parser-exciting
It relies on having the nomad-meta-info and the python common repositories one level higher.
The simplest way to have this is to check out nomad-lab-base recursively:
git clone --recursive git@gitlab.mpcdf.mpg.de:nomad-lab/nomad-lab-base.git
then this will be in parsers/exciting.
parser/parser-exciting/parser_exciting.py
0 → 100644
View file @
5c8c21d4
import
setup_paths
from
nomadcore.simple_parser
import
SimpleMatcher
,
mainFunction
from
nomadcore.local_meta_info
import
loadJsonFile
,
InfoKindEl
import
os
,
sys
,
json
# description of the input
mainFileDescription
=
SimpleMatcher
(
name
=
'root'
,
weak
=
True
,
startReStr
=
""
,
subMatchers
=
[
SimpleMatcher
(
name
=
'newRun'
,
startReStr
=
r
"\s*# SampleParser #\s*"
,
repeats
=
True
,
required
=
True
,
forwardMatch
=
True
,
sections
=
[
'section_run'
],
subMatchers
=
[
SimpleMatcher
(
name
=
'header'
,
startReStr
=
r
"\s*# SampleParser #\s*"
)
])
])
# loading metadata from nomad-meta-info/meta_info/nomad_meta_info/exciting.nomadmetainfo.json
metaInfoPath
=
os
.
path
.
normpath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
"../../../../nomad-meta-info/meta_info/nomad_meta_info/exciting.nomadmetainfo.json"
))
metaInfoEnv
,
warnings
=
loadJsonFile
(
filePath
=
metaInfoPath
,
dependencyLoader
=
None
,
extraArgsHandling
=
InfoKindEl
.
ADD_EXTRA_ARGS
,
uri
=
None
)
parserInfo
=
{
"name"
:
"parser_exciting"
,
"version"
:
"1.0"
}
# default unit conversions (actually it might be better to use the sourceUnits argument of the SimpleMatcher)
defaultSourceUnits
=
{}
if
__name__
==
"__main__"
:
mainFunction
(
mainFileDescription
,
metaInfoEnv
,
parserInfo
,
defaultSourceUnits
=
defaultSourceUnits
)
parser/parser-exciting/setup_paths.py
0 → 100644
View file @
5c8c21d4
import
sys
,
os
,
os
.
path
baseDir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
commonDir
=
os
.
path
.
normpath
(
os
.
path
.
join
(
baseDir
,
"../../../../python-common/python"
))
if
not
commonDir
in
sys
.
path
:
sys
.
path
.
insert
(
0
,
commonDir
)
test/examples/README.md
0 → 100644
View file @
5c8c21d4
sample files to test the parser
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