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

Remove BadPoscarWarning when POSCAR elements set by POTCAR #3662

Merged
merged 2 commits into from Feb 29, 2024

Conversation

esoteric-ephemera
Copy link
Contributor

A BadPoscarWarning was recently added to pymatgen.io.vasp.inputs.Poscar when the elements in the POSCAR are identified by the order of elements in the POTCAR file. Reading in the element names from POTCAR is valid VASP input, and it's even permitted to omit the species names in POSCAR because VASP reads them from POTCAR:
This line lists the species of the present ions. The given order should match the order of species appearing in the POTCAR file. This line is optional, if omitted the species names are taken from the POTCAR file.

This PR just removes the warning.

@janosh janosh added io Input/output functionality vasp Vienna Ab initio Simulation Package ux User experience labels Feb 29, 2024
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, nicely ruffled! 😄

@janosh janosh enabled auto-merge (squash) February 29, 2024 19:38
@janosh janosh merged commit 8fd181b into materialsproject:master Feb 29, 2024
22 checks passed
@DanielYang59
Copy link
Contributor

DanielYang59 commented Mar 1, 2024

Just came across this PR randomly... I guess I added this warning in #3539. I just had another look and I think this PR is right and I misunderstood the implementation. This

if check_for_potcar and SETTINGS.get("PMG_POTCAR_CHECKS") is not False:
potcars = glob(f"{dirname}/*POTCAR*")
if potcars:
try:
potcar = Potcar.from_file(sorted(potcars)[0])
names = [sym.split("_")[0] for sym in potcar.symbols]
[get_el_sp(n) for n in names] # ensure valid names
except Exception:
names = None

is nested under check_for_potcar. (I thought from_file is falling to element check from POTCAR because POSCAR is badly formatted, which seems not true). I'm sorry for this oversight and thanks for fixing this @esoteric-ephemera .

@janosh
Copy link
Member

janosh commented Mar 1, 2024

I'm sorry for this oversight

no worries. we live and learn :)

@janosh janosh added the fix Bug fix PRs label Mar 1, 2024
@esoteric-ephemera esoteric-ephemera deleted the fix_poscar_warn branch March 8, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix PRs io Input/output functionality ux User experience vasp Vienna Ab initio Simulation Package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants