Skip to content

Commit

Permalink
revert potcar checks, move to separate PR
Browse files Browse the repository at this point in the history
  • Loading branch information
esoteric-ephemera committed Mar 23, 2024
1 parent a9a6622 commit 52bf6f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 25 deletions.
33 changes: 9 additions & 24 deletions emmet-builders/emmet/builders/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
sys.stdout = self._original_stdout


def get_potcar_stats(strict: bool = True):
def get_potcar_stats():
default_settings = EmmetBuildSettings()

stats: dict[str, dict] = {} # type: ignore
Expand All @@ -231,29 +231,14 @@ def get_potcar_stats(strict: bool = True):
functional = _input._config_dict["POTCAR_FUNCTIONAL"]

for potcar_symbol in _input.CONFIG["POTCAR"].values():
if strict:
potcar = PotcarSingle.from_symbol_and_functional(
symbol=potcar_symbol, functional=functional
)
summary_stats = potcar._summary_stats.copy()
# fallback method for validation - use header hash and symbol
# note that the potcar_spec assigns PotcarSingle.symbol to "titel"
summary_stats["titel"] = potcar.TITEL
summary_stats["hash"] = potcar.md5_header_hash

else:
for titel_no_spc, entries in PotcarSingle._potcar_summary_stats[
functional
].items():
if any(potcar_symbol in entry for entry in entries):
_titel = titel_no_spc.split(potcar_symbol)
titel = f"{_titel[0]} {potcar_symbol} " + " ".join(_titel[1:])
summary_stats = [
{**entry, "titel": titel, "hash": None} for entry in entries
]

break

potcar = PotcarSingle.from_symbol_and_functional(
symbol=potcar_symbol, functional=functional
)
summary_stats = potcar._summary_stats.copy()
# fallback method for validation - use header hash and symbol
# note that the potcar_spec assigns PotcarSingle.symbol to "titel"
summary_stats["titel"] = potcar.TITEL
summary_stats["hash"] = potcar.md5_header_hash
stats[calc_type].update({potcar_symbol: summary_stats})

return stats
2 changes: 1 addition & 1 deletion emmet-builders/emmet/builders/vasp/task_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(
# Set up potcar cache if appropriate
if self.settings.VASP_VALIDATE_POTCAR_STATS:
if not self.potcar_stats:
self.potcar_stats = get_potcar_stats()
self.potcar_stats = get_potcar_stats(strict = False)
else:
self.potcar_stats = None

Expand Down

0 comments on commit 52bf6f3

Please sign in to comment.