Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PwParser: add support for output format of pw.x v6.6 #552

Merged
merged 1 commit into from
Sep 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions aiida_quantumespresso/parsers/parse_raw/pw.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,21 @@ def parse_stdout(stdout, input_parameters, parser_options=None, parsed_xml=None)
try:

En = float(line.split('=')[1].split('Ry')[0]) * ry_to_ev
E_acc = float(data_step[count + 2].split('<')[1].split('Ry')[0]) * ry_to_ev

# Up till v6.5, the line after total energy would be the Harris-Foulkes estimate, followed by the
# estimated SCF accuracy. However, pw.x v6.6 removed the HF estimate line.
marker = 'estimated scf accuracy'
for i in range(5):
subline = data_step[count + i]
if marker in subline:
try:
E_acc = float(subline.split('<')[1].split('Ry')[0]) * ry_to_ev
except Exception:
pass
else:
break
else:
raise KeyError('could not find and parse the line with `{}`'.format(marker))

for key, value in [['energy', En], ['energy_accuracy', E_acc]]:
trajectory_data.setdefault(key, []).append(value)
Expand Down Expand Up @@ -716,7 +730,10 @@ def parse_stdout(stdout, input_parameters, parser_options=None, parsed_xml=None)
trajectory_data.setdefault('energy_vdw', []).append(value)
break
parsed_data['energy_vdw' + units_suffix] = default_energy_units
except Exception:
except Exception as exception:
import traceback
traceback.print_exc()
print(exception)
logs.warning.append('Error while parsing for energy terms.')

elif 'the Fermi energy is' in line:
Expand Down
Loading