Skip to content

Commit c4296e4

Browse files
authored
Fix TestMPStaticSet using MPRelaxSet in test_user_incar_kspacing and test_kspacing_override (#3268)
* fix TestMPStaticSet running with MPRelaxSet instead of MPStaticSet in test_user_incar_kspacing and test_kspacing_override * add self.set attribute to InputSetTests to make it harder to use the wrong InputSet in a test * fix outdated ValueError msg in PotcarSingle.from_symbol_and_functional or you may need to set PMG_DEFAULT_FUNCTIONAL to PBE_52 or PBE_54 if you are using newer psps from VASP.
1 parent 9526451 commit c4296e4

File tree

3 files changed

+166
-166
lines changed

3 files changed

+166
-166
lines changed

pymatgen/io/vasp/inputs.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,18 +1882,17 @@ def from_symbol_and_functional(symbol: str, functional: str | None = None):
18821882
if d is None:
18831883
raise ValueError(
18841884
f"No POTCAR for {symbol} with {functional=} found. Please set the PMG_VASP_PSP_DIR "
1885-
"environment in .pmgrc.yaml, or you may need to set PMG_DEFAULT_FUNCTIONAL to PBE_52 or "
1886-
"PBE_54 if you are using newer psps from VASP."
1885+
"environment in .pmgrc.yaml."
18871886
)
18881887
paths_to_try = [
18891888
os.path.join(d, funcdir, f"POTCAR.{symbol}"),
18901889
os.path.join(d, funcdir, symbol, "POTCAR"),
18911890
]
1892-
for p in paths_to_try:
1893-
p = os.path.expanduser(p)
1894-
p = zpath(p)
1895-
if os.path.exists(p):
1896-
return PotcarSingle.from_file(p)
1891+
for path in paths_to_try:
1892+
path = os.path.expanduser(path)
1893+
path = zpath(path)
1894+
if os.path.isfile(path):
1895+
return PotcarSingle.from_file(path)
18971896
raise OSError(
18981897
f"You do not have the right POTCAR with {functional=} and label {symbol} "
18991898
f"in your VASP_PSP_DIR. Paths tried: {paths_to_try}"

tests/core/test_surface.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,15 @@ def setUp(self):
3939
["Ti", "Ti", "Ti"],
4040
[
4141
[0, 0, 0],
42-
[0.333333, 0.666667, 0.500000],
43-
[0.666667, 0.333333, 0.500000],
42+
[0.333333, 0.666667, 0.5],
43+
[0.666667, 0.333333, 0.5],
4444
],
4545
)
4646

4747
Ag_fcc = Structure(
4848
Lattice.cubic(4.06),
4949
["Ag", "Ag", "Ag", "Ag"],
50-
[
51-
[0, 0, 0],
52-
[0, 0.500000, 0.500000],
53-
[0.500000, 0, 0.500000],
54-
[0.500000, 0.500000, 0],
55-
],
50+
[[0, 0, 0], [0, 0.5, 0.5], [0.5, 0, 0.5], [0.5, 0.5, 0]],
5651
)
5752

5853
m = [[3.913449, 0, 0], [0, 3.913449, 0], [0, 0, 5.842644]]

0 commit comments

Comments
 (0)