Planned maintenance on Wednesday, 2021-01-20, 17:00-18:00. Expect some interruptions during that time

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 \
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'}
......@@ -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():
""" A proper class envolop for running this parser from within python. """
def __init__(self, backend, **kwargs):
......@@ -672,28 +662,15 @@ class SiestaParser():
from unittest.mock import patch
logging.info('siesta parser started')
logging.getLogger('nomadcore').setLevel(logging.WARNING)
backend = self.backend_factory(metaInfoEnv)
backend = self.backend_factory("siesta.nomadmetainfo.json")
context.reset()
with patch.object(sys, 'argv', ['<exe>', '--uri', 'nmd://uri', mainfile]):
mainFunction(
mainFileDescription,
metaInfoEnv,
None,
parser_info,
cachingLevelForMetaName={},
superContext=context,
superBackend=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