Skip to content

Commit

Permalink
fix some paths
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Apr 18, 2024
1 parent 4109a08 commit 7e64b5b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tests/analysis/test_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ def setUp(self):

# MoS2 example, structure graph obtained from critic2
# (not ground state, from mp-1023924, single layer)
stdout_file = f"{TEST_FILES_DIR}/critic2/MoS2_critic2_stdout.txt"
stdout_file = f"{TEST_FILES_DIR}/command_line/critic2/MoS2_critic2_stdout.txt"
with open(stdout_file) as txt_file:
reference_stdout = txt_file.read()
self.structure = Structure.from_file(f"{TEST_FILES_DIR}/critic2/MoS2.cif")
self.structure = Structure.from_file(f"{TEST_FILES_DIR}/command_line/critic2/MoS2.cif")
c2o = Critic2Analysis(self.structure, reference_stdout)
self.mos2_sg = c2o.structure_graph(include_critical_points=False)

Expand Down
2 changes: 1 addition & 1 deletion tests/electronic_structure/test_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def test_methods(self):

class TestPlotBZ(TestCase):
def setUp(self):
self.rec_latt = Structure.from_file(f"{TEST_FILES_DIR}/cssr/Si.cssr").lattice.reciprocal_lattice
self.rec_latt = Structure.from_file(f"{TEST_FILES_DIR}/io/cssr/Si.cssr").lattice.reciprocal_lattice
self.kpath = [[[0.0, 0.0, 0.0], [0.5, 0.0, 0.5], [0.5, 0.25, 0.75], [0.375, 0.375, 0.75]]]
self.labels = {
"\\Gamma": [0.0, 0.0, 0.0],
Expand Down
8 changes: 4 additions & 4 deletions tests/io/test_adf.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ def test_main(self):
task = AdfTask("optimize", **rhb18)
inp = AdfInput(task)
inp.write_file(mol, tmp_file)
expected = readfile(f"{TEST_DIR}/adf/RhB18_adf.inp")
expected = readfile(f"{TEST_DIR}/RhB18_adf.inp")
assert readfile(tmp_file) == expected


class TestAdfOutput:
def test_analytical_freq(self):
filename = f"{TEST_DIR}/adf/analytical_freq/adf.out"
filename = f"{TEST_DIR}/analytical_freq/adf.out"
adf_out = AdfOutput(filename)
assert adf_out.final_energy == approx(-0.54340325)
assert len(adf_out.energies) == 4
Expand All @@ -269,7 +269,7 @@ def test_analytical_freq(self):
assert adf_out.normal_modes[0][8] == approx(-0.562)

def test_numerical_freq(self):
filename = f"{TEST_DIR}/adf/numerical_freq/adf.out"
filename = f"{TEST_DIR}/numerical_freq/adf.out"
adf_out = AdfOutput(filename)
assert adf_out.freq_type == "Numerical"
assert len(adf_out.final_structure) == 4
Expand All @@ -285,7 +285,7 @@ def test_numerical_freq(self):
assert adf_out.normal_modes[1][9] == approx(-0.536)

def test_single_point(self):
filename = f"{TEST_DIR}/adf/sp/adf.out"
filename = f"{TEST_DIR}/sp/adf.out"
adf_out = AdfOutput(filename)
assert adf_out.final_energy == approx(-0.74399276)
assert len(adf_out.final_structure) == 4
2 changes: 1 addition & 1 deletion tests/io/test_cif.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ def test_disordered(self):
assert l1.strip() == l2.strip()

def test_cif_writer_without_refinement(self):
si2 = Structure.from_file(f"{TEST_FILES_DIR}/abinit/si.cif")
si2 = Structure.from_file(f"{TEST_FILES_DIR}/io/abinit/si.cif")

writer = CifWriter(si2, symprec=1e-3, significant_figures=10, refine_struct=False)
cif_str = str(writer)
Expand Down
6 changes: 3 additions & 3 deletions tests/io/vasp/test_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1913,11 +1913,11 @@ def test_get_parchg(self):
assert_allclose(c.data["total"], 0.0)

def test_write_unks(self):
unk_std = Unk.from_file(f"{TEST_FILES_DIR}/wannier90/UNK.N2.std")
unk_ncl = Unk.from_file(f"{TEST_FILES_DIR}/wannier90/UNK.H2.ncl")
unk_std = Unk.from_file(f"{TEST_FILES_DIR}/io/wannier90/UNK.N2.std")
unk_ncl = Unk.from_file(f"{TEST_FILES_DIR}/io/wannier90/UNK.H2.ncl")

with pytest.raises(ValueError, match="invalid directory"):
self.wavecar.write_unks(f"{TEST_FILES_DIR}/wannier90/UNK.N2.std")
self.wavecar.write_unks(f"{TEST_FILES_DIR}/io/wannier90/UNK.N2.std")

# different grids
self.wavecar.write_unks("./unk_dir")
Expand Down
2 changes: 1 addition & 1 deletion tests/phonon/test_thermal_displacements.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pymatgen.phonon.thermal_displacements import ThermalDisplacementMatrices
from pymatgen.util.testing import TEST_FILES_DIR, PymatgenTest

TEST_DIR = TEST_FILES_DIR / "phonopy"
TEST_DIR = f"{TEST_FILES_DIR}/io/phonopy"


class TestThermalDisplacement(PymatgenTest):
Expand Down

0 comments on commit 7e64b5b

Please sign in to comment.