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

BUG: Charge structure not parsed #154

Closed
jmmshn opened this issue Jul 8, 2022 · 2 comments
Closed

BUG: Charge structure not parsed #154

jmmshn opened this issue Jul 8, 2022 · 2 comments

Comments

@jmmshn
Copy link
Contributor

jmmshn commented Jul 8, 2022

When parsing the following directory into a TaskDocument.
The result should have +1 charge (NELECT = 349 vs 350 for the neutral)
The current version of the Vasprun Object in pymatgen gives Vasprun.structure.charge == -1 due to a bug fix in
materialsproject/pymatgen#2577

Either way, with or without the fix to the sign,the current parsing of the directory using TaskDocument gives zero charge:

tdoc = TaskDocument.from_directory("./")

Gives:

tdoc.structure.charge # --> 0

Files to reproduce linked below:

charged_vasprun_ex.zip

@jmmshn
Copy link
Contributor Author

jmmshn commented Jul 8, 2022

So it looks like this is cause:

structure = vasprun.final_structure

We use final_structure:
https://github.com/materialsproject/pymatgen/blob/d10c460b2b20b8802e345491bfe2301d1376650e/pymatgen/io/vasp/outputs.py#L496

Which calls _parse_structure that reconstructs the structure from the XML data without charge.

@jmmshn
Copy link
Contributor Author

jmmshn commented Jul 14, 2022

resolved in #155

@jmmshn jmmshn closed this as completed Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant