From 9e4f528a954354409f59f1ebb63f977bd71168a3 Mon Sep 17 00:00:00 2001 From: rosendo <rosendo.valero@gmail.com> Date: Tue, 21 Feb 2017 15:59:36 +0100 Subject: [PATCH] Changes to close x_gaussian_section_elstruc_method and section_XC_functionals properly --- parser/parser-gaussian/parser_gaussian.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/parser/parser-gaussian/parser_gaussian.py b/parser/parser-gaussian/parser_gaussian.py index ed9a932..8c0c901 100644 --- a/parser/parser-gaussian/parser_gaussian.py +++ b/parser/parser-gaussian/parser_gaussian.py @@ -1287,8 +1287,8 @@ class GaussianParserContext(object): gIndexTmp = backend.openSection('section_XC_functionals') backend.addValue('XC_functional_name', xcName) # write hybrid_xc_coeff for PBE1PBE into XC_functional_parameters - else: backend.closeSection('section_XC_functionals', gIndexTmp) + else: logger.error("The dictionary for xc functional '%s' does not have the key 'name'. Please correct the dictionary xcDict in %s." % (xc[-1], os.path.basename(__file__))) else: logger.error("The xc functional '%s' could not be converted for the metadata. Please add it to the dictionary xcDict in %s." % (xc[-1], os.path.basename(__file__))) @@ -1309,11 +1309,12 @@ class GaussianParserContext(object): methodName = methodItem.get('name') if methodName is not None: # write section and method name - gIndexTmp = backend.openSection('x_gaussian_section_elstruc_method') if methodprefix != None and methodreal != None: + gIndexTmp = backend.openSection('x_gaussian_section_elstruc_method') backend.addValue('x_gaussian_electronic_structure_method', str(methodprefix) + methodreal) backend.closeSection('x_gaussian_section_elstruc_method', gIndexTmp) elif methodreal != None: + gIndexTmp = backend.openSection('x_gaussian_section_elstruc_method') backend.addValue('x_gaussian_electronic_structure_method', methodreal) backend.closeSection('x_gaussian_section_elstruc_method', gIndexTmp) else: -- GitLab