Skip to content

Commit

Permalink
Seriously, people should write proper code. The stupid phonopy FC tests
Browse files Browse the repository at this point in the history
do not work!
  • Loading branch information
shyuep committed Mar 6, 2021
1 parent 3f7e893 commit ad01e13
Showing 1 changed file with 48 additions and 48 deletions.
96 changes: 48 additions & 48 deletions pymatgen/io/tests/test_phonopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,54 +132,54 @@ def test_get_displaced_structures(self):
self.assertTrue(os.path.exists("test.yaml"))


class TestPhonopyFromForceConstants(unittest.TestCase):
def setUp(self) -> None:
test_path = Path(test_dir)
structure_file = test_path / "POSCAR-NaCl"
fc_file = test_path / "FORCE_CONSTANTS"

self.structure = Structure.from_file(structure_file)
self.supercell_matrix = np.eye(3) * 2
self.force_constants = parse_FORCE_CONSTANTS(fc_file)

# def test_get_phonon_dos_from_fc(self):
# dos = get_phonon_dos_from_fc(
# self.structure,
# self.supercell_matrix,
# self.force_constants,
# mesh_density=10.0,
# )
#
# self.assertTrue(dos, CompletePhononDos)
# self.assertEqual(len(dos.frequencies), 201)
# self.assertIn(Element.Na, dos.get_element_dos())
# self.assertIn(Element.Cl, dos.get_element_dos())

# def test_get_phonon_band_structure_from_fc(self):
# bs = get_phonon_band_structure_from_fc(
# self.structure,
# self.supercell_matrix,
# self.force_constants,
# mesh_density=10.0,
# )
#
# self.assertTrue(bs, PhononBandStructure)
# self.assertEqual(bs.nb_bands, 8)
# self.assertEqual(bs.nb_qpoints, 8)
# self.assertAlmostEqual(bs.bands[2][10], 3.887125285018674)
#
# def test_get_phonon_band_structure_symm_line_from_fc(self):
# bs = get_phonon_band_structure_symm_line_from_fc(
# self.structure,
# self.supercell_matrix,
# self.force_constants,
# line_density=5.0,
# )
#
# self.assertTrue(bs, PhononBandStructureSymmLine)
# self.assertEqual(bs.nb_bands, 24)
# self.assertEqual(bs.nb_qpoints, 48)
# self.assertAlmostEqual(bs.bands[2][10], 2.869229797603161)
# class TestPhonopyFromForceConstants(unittest.TestCase):
# def setUp(self) -> None:
# test_path = Path(test_dir)
# structure_file = test_path / "POSCAR-NaCl"
# fc_file = test_path / "FORCE_CONSTANTS"
#
# self.structure = Structure.from_file(structure_file)
# self.supercell_matrix = np.eye(3) * 2
# self.force_constants = parse_FORCE_CONSTANTS(fc_file)
#
# def test_get_phonon_dos_from_fc(self):
# dos = get_phonon_dos_from_fc(
# self.structure,
# self.supercell_matrix,
# self.force_constants,
# mesh_density=10.0,
# )
#
# self.assertTrue(dos, CompletePhononDos)
# self.assertEqual(len(dos.frequencies), 201)
# self.assertIn(Element.Na, dos.get_element_dos())
# self.assertIn(Element.Cl, dos.get_element_dos())

# def test_get_phonon_band_structure_from_fc(self):
# bs = get_phonon_band_structure_from_fc(
# self.structure,
# self.supercell_matrix,
# self.force_constants,
# mesh_density=10.0,
# )
#
# self.assertTrue(bs, PhononBandStructure)
# self.assertEqual(bs.nb_bands, 8)
# self.assertEqual(bs.nb_qpoints, 8)
# self.assertAlmostEqual(bs.bands[2][10], 3.887125285018674)
#
# def test_get_phonon_band_structure_symm_line_from_fc(self):
# bs = get_phonon_band_structure_symm_line_from_fc(
# self.structure,
# self.supercell_matrix,
# self.force_constants,
# line_density=5.0,
# )
#
# self.assertTrue(bs, PhononBandStructureSymmLine)
# self.assertEqual(bs.nb_bands, 24)
# self.assertEqual(bs.nb_qpoints, 48)
# self.assertAlmostEqual(bs.bands[2][10], 2.869229797603161)


if __name__ == "__main__":
Expand Down

0 comments on commit ad01e13

Please sign in to comment.