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

Improve handling of Vasprun POTCAR search, expanded fake POTCAR library for VASP I/O tests #3491

Merged
merged 17 commits into from
Jan 17, 2024

Conversation

esoteric-ephemera
Copy link
Contributor

@esoteric-ephemera esoteric-ephemera commented Dec 4, 2023

  • In io.vasp.outputs, rewrote the Vasprun.get_potcars function to not fail in cases where multiple files named POTCAR* are found in the cwd, but only one is actually a POTCAR
  • Added fake POTCAR libraries to replace real POTCAR libraries in tests/files to stop infringing VASP copyright. Also added a PBE_64 fake POTCAR library to support PR #3484
  • To resolve pymatgen.io.vasp docs page is very slow to load and scroll #3556 , make potcar_summary_stats a private attr of pymatgen.io.vasp.inputs.PotcarSingle (rename to _potcar_summary_stats)

Copy link
Member

@janosh janosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @esoteric-ephemera, much appreciated! 👍

I think we can rename fake_potcar_library to just fake_potcars to keep the file paths shorter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you compress this file like the others?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and done!

@janosh janosh added tests Issues with or changes to the pymatgen test suite io Input/output functionality vasp Vienna Ab initio Simulation Package license Licensing and copyright stuff labels Dec 5, 2023
assert self.set(struct).nelect == 16
assert MPRelaxSet(struct).nelect == 22
assert self.set(struct).nelect == 18.758
assert MPRelaxSet(struct).nelect == 27.166
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did these values change? Are the fake POTCARs different even in the valence electrons? Could that have downstream implications? Like if we ever tested the same way we do in atomate2, we no longer can use actual VASP output as references files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The POTCARs have all non-string fields randomized, including the valence. Wouldn't be too challenging to change this. Another option is to simply change the data in the body of the POTCAR, since the header data is included in vasprun.xml and OUTCAR. And then I'm guessing not copyright protected, but would need confirmation from vasp

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only randomizing the POTCAR body data would be ideal, I think! Esp. if that means our tests can be more in line with actual VASP output!

OUTCARs are freely shared afaik so doubt there's copyright on the POTCAR headers. Maybe @MichaelWolloch or @sudarshanv01 can confirm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @janosh really sorry this took me forever to get back to! I've modified the POTCAR scrambling to only change data that doesn't appear in OUTCAR. That's basically everything after the line "Error from kinetic energy argument (eV)"

Pending tests passing, should be good to go!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And to just be clear, that means properties like the number of electrons, nuclear charge, core radii, etc. are unaffected. Only the values of the pseudopotential and the kinetic energy corrections (which I don't think are meaningful to most)

Copy link
Member

@janosh janosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @esoteric-ephemera! 👍 Carefully went through the whole PR again. This is excellent work!

@janosh janosh enabled auto-merge (squash) January 17, 2024 08:30
@janosh janosh merged commit 181c365 into materialsproject:master Jan 17, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
io Input/output functionality license Licensing and copyright stuff tests Issues with or changes to the pymatgen test suite vasp Vienna Ab initio Simulation Package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pymatgen.io.vasp docs page is very slow to load and scroll
2 participants