Skip to content

Commit 39833d7

Browse files
committed
Add Potcar import and simplify input validation
1 parent 9457d30 commit 39833d7

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

vsh/scripts/manage.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from PIL import Image
55
import os
66

7-
from pymatgen.io.vasp import Poscar, Incar, Kpoints
7+
from pymatgen.io.vasp import Poscar, Incar, Kpoints, Potcar
88

99
def validate_input(args):
1010
"""Validates that INCAR, POSCAR, KPOINTS, and POTCAR files are present and formatted correctly"""
@@ -20,13 +20,10 @@ def validate_input(args):
2020
raise FileNotFoundError(f"File not found: {file}")
2121

2222
# check that each file is formatted correctly
23-
incar = Incar.from_file(incar_file)
24-
poscar = Poscar.from_file(poscar_file)
25-
kpoints = Kpoints.from_file(kpoints_file)
26-
potcar = Potcar.from_file(potcar_file)
27-
28-
# check that incar has valid tags
29-
incar.check_params() # stdout is empty if no errors
23+
Incar.from_file(incar_file).check_params()
24+
Poscar.from_file(poscar_file)
25+
Kpoints.from_file(kpoints_file)
26+
Potcar.from_file(potcar_file)
3027

3128
print("Input files validated successfully")
3229

0 commit comments

Comments
 (0)