diff --git a/src/aiida_quantumespresso_hp/parsers/parse_raw/hp.py b/src/aiida_quantumespresso_hp/parsers/parse_raw/hp.py index 5041839..96b5a4e 100644 --- a/src/aiida_quantumespresso_hp/parsers/parse_raw/hp.py +++ b/src/aiida_quantumespresso_hp/parsers/parse_raw/hp.py @@ -31,13 +31,13 @@ def parse_raw_output(stdout): detect_important_message(logs, line) # A calculation that will only perturb a single atom will only print one line - match = re.search(r'.*The grid of q-points.*\s+([0-9]+)+\s+q-points.*', line) + match = re.search(r'.*The grid of q-points.*?(\d+)+\s+q-points.*', line) if match: parsed_data['number_of_qpoints'] = int(match.group(1)) # Determine the atomic sites that will be perturbed, or that the calculation expects # to have been calculated when post-processing the final matrices - match = re.search(r'.*List of\s+([0-9]+)\s+atoms which will be perturbed.*', line) + match = re.search(r'.*List of.*?(\d+)\s+atoms which will be perturbed.*', line) if match: hubbard_sites = {} number_of_perturbed_atoms = int(match.group(1)) diff --git a/tests/parsers/fixtures/hp/initialization_only_mesh_more_points/aiida.out b/tests/parsers/fixtures/hp/initialization_only_mesh_more_points/aiida.out index a5b4b02..dc3e095 100644 --- a/tests/parsers/fixtures/hp/initialization_only_mesh_more_points/aiida.out +++ b/tests/parsers/fixtures/hp/initialization_only_mesh_more_points/aiida.out @@ -167,7 +167,7 @@ Changing the type of the perturbed atom back to its original type... - The grid of q-points ( 4, 4, 4) ( 18 q-points ) : + The grid of q-points ( 4, 4, 4) (18 q-points ) : N xq(1) xq(2) xq(3) wq 1 0.000000000 0.000000000 0.000000000 0.015625000 2 0.000000000 0.216131358 -0.211002628 0.062500000