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

Parsing Failure of vasprun.xml from MD Simulations Using MLFF #4200

Open
yutoml opened this issue Nov 26, 2024 · 0 comments
Open

Parsing Failure of vasprun.xml from MD Simulations Using MLFF #4200

yutoml opened this issue Nov 26, 2024 · 0 comments
Labels

Comments

@yutoml
Copy link

yutoml commented Nov 26, 2024

Python version

Python 3.10.14

Pymatgen version

Version: 2024.11.13

Operating system version

Red Hat Enterprise Linux Ver 8.6

Current behavior

When trying to parse the vasprun.xml file generated from calculations using MLFF with the Vasprun class, an IndexError: list index out of range is raised at line 625 of pymatgen.io.vasp.outputs.py when accessing self.ionic_steps[-1]["electronic_steps"]. This seems to occur because, in MLFF calculations, data is stored in md_data instead of ionic_steps, leaving ionic_steps empty. Additionally, when ionic_step_offset or ionic_step_skip is specified during the creation of a Vasprun object, parsing fails because the vasprun.xml generated by MLFF calculations does not contain the <calculation> tag, which prevents parsing from working as expected.

Expected Behavior

Parsing the vasprun.xml file generated from MD calculations using MLFF should not result in an error. While I am not entirely familiar with the code, changing the condition at line 348 in outputs.py from

if self.incar.get("ALGO") not in {"Chi", "Bse"} and not self.converged and self.parameters.get("IBRION") != 0:

to

if self.incar.get("ALGO") not in {"Chi", "Bse"} and self.parameters.get("IBRION") != 0 and not self.converged:

allowed me to parse the file successfully for now. However, errors still occur when ionic_step_offset or ionic_step_skip are used, and it is possible that there are other parts of the code where ionic_steps are referenced when md_data should be used instead.

Minimal example

from pymatgen.io.vasp.outputs import Vasprun
vasprun_xml = Vasprun("vasprun.xml")

Relevant files to reproduce this bug

I am attaching a sample vasprun.xml file created for the purpose of reproducing this issue.
vasprun.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant