Exemplo n.º 1
0
def main(args):
    if args.overwrite and os.path.exists(args.db_path):
        logging.info("Removing old database at {}".format(args.db_path))
        os.remove(args.db_path)

    os.makedirs(os.path.dirname(args.db_path), exist_ok=True)

    logging.info("parsing data...")
    generate_db(args.file_path, args.db_path, args.atomic_properties,
                args.molecular_properties)

    logging.info("done...")
Exemplo n.º 2
0
def parse(file_path, db_path, atomic_properties, molecular_properties):
    """
    Runs the data parsing.

    Args:
        file_path (str): path to input file
        db_path (str): path to output file
        atomic_properties (str): property string for .xyz files
        molecular_properties (list): list with molecular properties in
            comment section
    """
    save_config(cfg_dir=os.path.dirname(db_path))
    generate_db(file_path, db_path, atomic_properties, molecular_properties)