#!/usr/bin/env python3

"""Expand a vasp geometry"""
import argparse
from pyRDTP import geomio

PARSER = argparse.ArgumentParser(description='Expand the given geometry')
PARSER.add_argument("-i", type=str, default='POSCAR',
                    help="Location of the POSCAR file.")
PARSER.add_argument("-o", type=str, default='POSCAR',
                    help="Location of the output with the new coordinates.")
PARSER.add_argument("-x", type=int, default=1,
                    help="Expansion in the x axis, must be an integer.")
PARSER.add_argument("-y", type=int, default=1,
                    help="Expansion in the y axis, must be an integer.")
PARSER.add_argument("-z", type=int, default=1,
                        help="Expansion in the z axis, must be an integer.")

ARGS = PARSER.parse_args()

BULK = geomio.file_to_mol(ARGS.i, 'contcar', bulk=True)
BULK.expand(x=ARGS.x, y=ARGS.y, z=ARGS.z)
geomio.mol_to_file(BULK, ARGS.o, 'contcar')
