77
88from wfl .configset import ConfigSet , OutputSpec
99from wfl .generate .phonopy import phonopy
10+ try :
11+ import phono3py
12+ except ImportError :
13+ phono3py = None
1014
1115
1216def test_phonopy (tmp_path ):
@@ -33,6 +37,7 @@ def test_phonopy(tmp_path):
3337 for v in at .positions [1 :]:
3438 assert min (np .linalg .norm (sc .positions [1 :] - v , axis = 1 )) < 1.0e-7
3539
40+ @pytest .mark .skipif (phono3py is None , reason = "No phono3py module" )
3641def test_phono3py (tmp_path ):
3742 at0 = Atoms (numbers = [29 ], cell = [[0 , 2 , 2 ], [2 , 0 , 2 ], [2 , 2 , 0 ]], positions = [[0 , 0 , 0 ]], pbc = [True ]* 3 )
3843 at1 = Atoms (numbers = [29 ], cell = [[0 , 1.9 , 1.9 ], [1.9 , 0 , 1.9 ], [1.9 , 1.9 , 0 ]], positions = [[0 , 0 , 0 ]], pbc = [True ]* 3 )
@@ -62,6 +67,7 @@ def test_phono3py(tmp_path):
6267 assert sum ([at .info ["config_type" ] == "phonon_cubic_1" for at in pert ]) == 13 * 2
6368
6469
70+ @pytest .mark .skipif (phono3py is None , reason = "No phono3py module" )
6571def test_phono3py_same_supercell (tmp_path ):
6672 at0 = Atoms (numbers = [29 ], cell = [[0 , 2 , 2 ], [2 , 0 , 2 ], [2 , 2 , 0 ]], positions = [[0 , 0 , 0 ]], pbc = [True ]* 3 )
6773 at1 = Atoms (numbers = [29 ], cell = [[0 , 1.9 , 1.9 ], [1.9 , 0 , 1.9 ], [1.9 , 1.9 , 0 ]], positions = [[0 , 0 , 0 ]], pbc = [True ]* 3 )
0 commit comments