Skip to content

Commit

Permalink
relocate fake_potcars
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Mar 9, 2024
1 parent 64d04e5 commit 61d6cd3
Show file tree
Hide file tree
Showing 38 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions dev_scripts/potcar_scrambler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from pymatgen.core import SETTINGS
from pymatgen.io.vasp import Potcar, PotcarSingle
from pymatgen.io.vasp.sets import _load_yaml_config
from pymatgen.util.testing import VASP_IN_DIR


class PotcarScrambler:
Expand Down Expand Up @@ -181,7 +180,7 @@ def potcar_cleanser():
and freely shared by VASP)
"""

search_dir = f"{VASP_IN_DIR}/fake_potcars/real_potcars/"
search_dir = "../tests/files/fake_potcars/real_potcars/"
rebase_dir = search_dir.replace("real", "fake")
potcars_to_cleanse = glob(f"{search_dir}/**/POTCAR*", recursive=True)

Expand Down
2 changes: 1 addition & 1 deletion pymatgen/util/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# fake POTCARs have original header information, meaning properties like number of electrons,
# nuclear charge, core radii, etc. are unchanged (important for testing) while values of the and
# pseudopotential kinetic energy corrections are scrambled to avoid VASP copyright infringement
FAKE_POTCAR_DIR = f"{VASP_IN_DIR}/fake_potcars"
FAKE_POTCAR_DIR = TEST_FILES_DIR / "fake_potcars"


class PymatgenTest(unittest.TestCase):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/io/vasp/test_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def test_selective_dynamics(self):
# that was sorted to the top of a list of POTCARs for the test to work.
# That's far too brittle - isolating requisite files here
copyfile(f"{VASP_IN_DIR}/POSCAR_Fe3O4", tmp_poscar_path := f"{self.tmp_path}/POSCAR")
copyfile(f"{VaspInput}fake_potcars/POTCAR.gz", f"{self.tmp_path}/POTCAR.gz")
copyfile(f"{TEST_FILES_DIR}/fake_potcars/POTCAR.gz", f"{self.tmp_path}/POTCAR.gz")

poscar = Poscar.from_file(tmp_poscar_path)
structure = poscar.structure
Expand Down
2 changes: 1 addition & 1 deletion tests/io/vasp/test_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ def test_parse_potcar_cwd_relative(self):
# See gh-3586
copyfile(f"{VASP_OUT_DIR}/vasprun.Al.xml.gz", "vasprun.xml.gz")

potcar_path = f"{VASP_IN_DIR}/fake_potcars/POTPAW_PBE_54/POTCAR.Al.gz"
potcar_path = f"{TEST_FILES_DIR}/fake_potcars/POTPAW_PBE_54/POTCAR.Al.gz"
copyfile(potcar_path, "POTCAR.gz")

potcar = Potcar.from_file(potcar_path)
Expand Down

0 comments on commit 61d6cd3

Please sign in to comment.