diff --git a/parser/parser-octopus/octopus_info_parser.py b/parser/parser-octopus/octopus_info_parser.py index 6988176..b956703 100644 --- a/parser/parser-octopus/octopus_info_parser.py +++ b/parser/parser-octopus/octopus_info_parser.py @@ -1,7 +1,7 @@ from builtins import object import logging import setup_paths -from nomadcore.simple_parser import mainFunction, SimpleMatcher as SM +from nomadcore.simple_parser import mainFunction, SimpleMatcher as SM, runParser from nomadcore.local_meta_info import loadJsonFile, InfoKindEl from nomadcore.unit_conversion.unit_conversion \ import register_userdefined_quantity @@ -80,11 +80,14 @@ class OctopusParserContext(object): def parse_infofile(metaInfoEnv, pew, fname): - #with open('info-parser.log', 'w') as fd: + def parsefile(parser_builder, uri, path, backend, super_context): + with open(path) as fd: + runParser(parser_builder, backend, super_context, fd) + mainFunction(infoFileDescription, metaInfoEnv, parserInfo, - #outF=fd, + parseFile=parsefile, cachingLevelForMetaName={}, superBackend=pew, superContext=OctopusParserContext(), diff --git a/parser/parser-octopus/parser_octopus.py b/parser/parser-octopus/parser_octopus.py index f157174..41138ed 100644 --- a/parser/parser-octopus/parser_octopus.py +++ b/parser/parser-octopus/parser_octopus.py @@ -262,8 +262,8 @@ def parse(fname, fd): nspins = calc.get_number_of_spins() nkpts = len(calc.get_k_point_weights()) - #print('Parse info file using SimpleMatcher', file=fd) - #parse_infofile(metaInfoEnv, pew, fname) + print('Parse info file using SimpleMatcher', file=fd) + parse_infofile(metaInfoEnv, pew, fname) #logfile = find_octopus_logfile(dirname) #if logfile is None: