@@ -1893,7 +1893,10 @@ class TestLobsterSet(PymatgenTest):
1893
1893
def setUp (self ):
1894
1894
self .set = LobsterSet
1895
1895
file_path = f"{ VASP_IN_DIR } /POSCAR"
1896
+ file_path2 = f"{ VASP_IN_DIR } /POSCAR.lobster.spin_DOS"
1896
1897
self .struct = Structure .from_file (file_path )
1898
+ self .struct2 = Structure .from_file (file_path2 )
1899
+
1897
1900
# test for different parameters!
1898
1901
self .lobsterset1 = self .set (self .struct , isym = - 1 , ismear = - 5 )
1899
1902
self .lobsterset2 = self .set (self .struct , isym = 0 , ismear = 0 )
@@ -1923,6 +1926,9 @@ def setUp(self):
1923
1926
# test W_sw
1924
1927
self .lobsterset8 = self .set (Structure .from_file (f"{ TEST_FILES_DIR } /electronic_structure/cohp/POSCAR.W" ))
1925
1928
1929
+ # test if potcar selection is consistent with PBE_54
1930
+ self .lobsterset9 = self .set (self .struct2 )
1931
+
1926
1932
def test_incar (self ):
1927
1933
incar1 = self .lobsterset1 .incar
1928
1934
assert "NBANDS" in incar1
@@ -1950,6 +1956,13 @@ def test_kpoints(self):
1950
1956
def test_potcar (self ):
1951
1957
# PBE_54 is preferred at the moment
1952
1958
assert self .lobsterset1 .user_potcar_functional == "PBE_54"
1959
+ # test if potcars selected are consistent with PBE_54
1960
+ assert self .lobsterset2 .potcar .symbols == ["Fe_pv" , "P" , "O" ]
1961
+ # test if error raised contains correct potcar symbol for K element as PBE_54 set
1962
+ with pytest .raises (
1963
+ OSError , match = "You do not have the right POTCAR with functional='PBE_54' and symbol='K_sv'"
1964
+ ):
1965
+ _ = self .lobsterset9 .potcar .symbols
1953
1966
1954
1967
def test_as_from_dict (self ):
1955
1968
dict_here = self .lobsterset1 .as_dict ()
0 commit comments