Skip to content
Snippets Groups Projects
Commit c140bcb8 authored by Adriel Domínguez's avatar Adriel Domínguez
Browse files

creating necessary directories and files for dftb+ parser

parent f1b5c217
No related branches found
No related tags found
No related merge requests found
File added
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/fhi_aims.nomadmetainfo.json
parserInfo = {
"name": "sample_parser",
"version": "1.0"
}
metaInfoPath = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)),"../../../../nomad-meta-info/meta_info/nomad_meta_info/sample_parser.nomadmetainfo.json"))
metaInfoEnv, warnings = loadJsonFile(filePath = metaInfoPath, dependencyLoader = None, extraArgsHandling = InfoKindEl.ADD_EXTRA_ARGS, uri = None)
if __name__ == "__main__":
mainFunction(mainFileDescription, metaInfoEnv, parserInfo)
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)
File added
sample files to test the parser
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment