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

Add new .pmgrc.yaml setting PMG_VASP_PSP_SUB_DIRS: dict[str, str] #3858

Merged
merged 6 commits into from
Jun 4, 2024

Conversation

janosh
Copy link
Member

@janosh janosh commented Jun 4, 2024

the current PotcarSingle.functional_dir hard-codes the subfolder structure of PMG_VASP_PSP_DIR. e.g. the subfolder containing the PBE_64 POTCARs must be named POT_PAW_PBE_64. this causes problems e.g. in cases where the POTCARs are shared across an HPC cluster and users don't have permissions to rename shared files (just happened to me).

# We indicate the older release in `functional_dir` as PBE_52, PBE_54, LDA_52, LDA_54.
# The newer release is indicated as PBE_52_W_HASH, etc.
functional_dir: ClassVar = {
"PBE": "POT_GGA_PAW_PBE",
"PBE_52": "POT_GGA_PAW_PBE_52",
"PBE_52_W_HASH": "POTPAW_PBE_52",
"PBE_54": "POT_GGA_PAW_PBE_54",
"PBE_54_W_HASH": "POTPAW_PBE_54",
"PBE_64": "POT_PAW_PBE_64",
"LDA": "POT_LDA_PAW",
"LDA_52": "POT_LDA_PAW_52",
"LDA_52_W_HASH": "POTPAW_LDA_52",
"LDA_54": "POT_LDA_PAW_54",
"LDA_54_W_HASH": "POTPAW_LDA_54",
"LDA_64": "POT_LDA_PAW_64",
"PW91": "POT_GGA_PAW_PW91",
"LDA_US": "POT_LDA_US",
"PW91_US": "POT_GGA_US_PW91",
"Perdew_Zunger81": "POT_LDA_PAW",
}
functional_tags: ClassVar = {
"pe": {"name": "PBE", "class": "GGA"},

the new setting is read from .pmgrc.yaml and overrides the PotcarSingle.functional_dir names (leaving unspecified ones as is). example:

# .pmgrc.yaml
PMG_VASP_PSP_DIR: /path/to/pseudo-potentials
PMG_VASP_PSP_SUB_DIRS:
  PBE_64: MY_PBE_64_DIR
  LDA_64: MY_LDA_64_DIR

this PR implement the new setting, adds tests for it and restores (uncomments) + fixes an existing PotcarSingle test
also improves FileNotFoundError messages on missing POTCARs

@janosh janosh added enhancement A new feature or improvement to an existing one io Input/output functionality vasp Vienna Ab initio Simulation Package ux User experience labels Jun 4, 2024
@janosh
Copy link
Member Author

janosh commented Jun 4, 2024

pinging @esoteric-ephemera since i can't request a review from you but would be great to get your thoughts if any

@mkhorton
Copy link
Member

mkhorton commented Jun 4, 2024

Seems reasonable to me. I am not familiar with the W_HASH variants.

@esoteric-ephemera
Copy link
Contributor

This looks good to me! This can also benefit those who are newer to VASP and only care about more recent generations of pseudopotentials.

@mkhorton: afaik, these are identical to the non _W_HASH variants ({PBE,LDA}_52, {PBE,LDA}_54) but with a SHA and possibly COPYR field added.

@janosh janosh merged commit c55e056 into master Jun 4, 2024
33 checks passed
@janosh janosh deleted the pmg-vasp-psp-sub-dirs branch June 4, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or improvement to an existing one 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