Commit 9965ca2f authored by Markus Scheidgen's avatar Markus Scheidgen

Remove dependency on old metainfo.

parent 9185e1b7
...@@ -34,12 +34,6 @@ from nomadcore.unit_conversion.unit_conversion \ ...@@ -34,12 +34,6 @@ from nomadcore.unit_conversion.unit_conversion \
from siestaparser.inputvars import varlist from siestaparser.inputvars import varlist
# metaInfoPath = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)),"../../../../nomad-meta-info/meta_info/nomad_meta_info/siesta.nomadmetainfo.json"))
# metaInfoEnv, warnings = loadJsonFile(filePath=metaInfoPath,
# dependencyLoader=None,
# extraArgsHandling=InfoKindEl.ADD_EXTRA_ARGS,
# uri=None)
parser_info = {'name':'siesta-parser', 'version': '1.0'} parser_info = {'name':'siesta-parser', 'version': '1.0'}
...@@ -659,10 +653,6 @@ mainFileDescription = SM( ...@@ -659,10 +653,6 @@ mainFileDescription = SM(
]) ])
import nomad_meta_info
metaInfoPath = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(nomad_meta_info.__file__)), "siesta.nomadmetainfo.json"))
metaInfoEnv, warnings = loadJsonFile(filePath = metaInfoPath, dependencyLoader = None, extraArgsHandling = InfoKindEl.ADD_EXTRA_ARGS, uri = None)
class SiestaParser(): class SiestaParser():
""" A proper class envolop for running this parser from within python. """ """ A proper class envolop for running this parser from within python. """
def __init__(self, backend, **kwargs): def __init__(self, backend, **kwargs):
...@@ -672,28 +662,15 @@ class SiestaParser(): ...@@ -672,28 +662,15 @@ class SiestaParser():
from unittest.mock import patch from unittest.mock import patch
logging.info('siesta parser started') logging.info('siesta parser started')
logging.getLogger('nomadcore').setLevel(logging.WARNING) logging.getLogger('nomadcore').setLevel(logging.WARNING)
backend = self.backend_factory(metaInfoEnv) backend = self.backend_factory("siesta.nomadmetainfo.json")
context.reset() context.reset()
with patch.object(sys, 'argv', ['<exe>', '--uri', 'nmd://uri', mainfile]): with patch.object(sys, 'argv', ['<exe>', '--uri', 'nmd://uri', mainfile]):
mainFunction( mainFunction(
mainFileDescription, mainFileDescription,
metaInfoEnv, None,
parser_info, parser_info,
cachingLevelForMetaName={}, cachingLevelForMetaName={},
superContext=context, superContext=context,
superBackend=backend) superBackend=backend)
return backend return backend
def main(**kwargs):
mainFunction(mainFileDescription=mainFileDescription,
metaInfoEnv=metaInfoEnv,
parserInfo=parser_info,
cachingLevelForMetaName={},
superContext=context,
**kwargs)
if __name__ == '__main__':
main()
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