File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,20 +125,13 @@ def is_valid_poscar(filename: str, directory: str = "./") -> bool:
125125 """
126126 filepath = os .path .join (directory , filename )
127127
128- # Check file exists
129- if not os .path .isfile (filepath ):
130- logger .warning (f"{ filename } does not exist in { directory } " )
131- return False
132-
133- # Check file is not empty
134- if os .path .getsize (filepath ) == 0 :
135- logger .warning (f"{ filename } is empty" )
128+ # Check file exists and is not blank
129+ if not os .path .isfile (filepath ) or os .path .getsize (filepath ) == 0 :
136130 return False
137131
138132 # Try to parse as POSCAR
139133 try :
140134 Poscar .from_file (filepath )
141135 return True
142- except Exception as exc :
143- logger .warning (f"{ filename } could not be parsed: { exc } " )
136+ except Exception :
144137 return False
You can’t perform that action at this time.
0 commit comments