Skip to content

Commit

Permalink
Fix command line argument parsing in input.py and
Browse files Browse the repository at this point in the history
slab.py
  • Loading branch information
wladerer committed Nov 29, 2023
1 parent 170b98d commit e13b228
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion vsh/scripts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def input(subparsers):
help="Directory to write VASP inputs to",
)
subp_inputs.add_argument(
"--potcar", type=bool, default=False, help="Write POTCAR file"
"--potcar", action='store_true', help="Write POTCAR file"
)
subp_inputs.add_argument(
"-k",
Expand Down
6 changes: 3 additions & 3 deletions vsh/scripts/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def get_atoms(args):
def write_potcar(args):
'''Writes a POTCAR file'''

atoms = args.atoms
structure = args.input
#get symbols
symbols = atoms.get_chemical_symbols()
symbols = structure.get_chemical_symbols()

potcar = Potcar(symbols, functional='PBE')
potcar = Potcar(symbols, functional='PBE_54')

if not args.output:
print(potcar)
Expand Down
4 changes: 3 additions & 1 deletion vsh/scripts/slab.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ def freeze_slab(structure: Structure, min_z: float) -> Structure:

def run(args):

args.vacuum = 3 if args.in_unit_planes else args.vacuum
if args.vacuum != 0:
args.vacuum = 3 if args.in_unit_planes else args.vacuum


structure = structure_from_file(args.structure)
slabs = slab_from_structure(
structure=structure,
Expand Down

0 comments on commit e13b228

Please sign in to comment.