# Path: pyDFTutils/vasp/vasp_utils.py
# def get_electrons(filename='POTCAR'):
#     """
#     get dict {symbol: valence} from POTCAR
#     """
#     nelect = dict()
#     lines = open(filename).readlines()
#     for n, line in enumerate(lines):
#         if line.find('TITEL') != -1:
#             symbol = line.split('=')[1].split()[1].split('_')[0].strip()
#             valence = float(
#                 lines[n + 4].split(';')[1].split('=')[1].split()[0].strip())
#             nelect[symbol] = valence
#     return nelect


from .vasp_utils import get_electrons
from pyDFTutils.ase_utils.chemsymbol import get_symdict
from ase.io import read
import matplotlib.pyplot as plt
import os
import numpy as np
    import re
#! /usr/bin/env python

def run_bader(filename='CHGCAR'):
    if os.path.exists('AECCAR0') and os.path.exists('AECCAR2'):
        if not os.path.exists('CHGCAR_sum'):

# Path: pyDFTutils/vasp/vasp_utils.py
# def get_electrons(filename='POTCAR'):
#     """
#     get dict {symbol: valence} from POTCAR
#     """
#     nelect = dict()
#     lines = open(filename).readlines()
#     for n, line in enumerate(lines):
#         if line.find('TITEL') != -1:
#             symbol = line.split('=')[1].split()[1].split('_')[0].strip()
#             valence = float(
#                 lines[n + 4].split(';')[1].split('=')[1].split()[0].strip())
#             nelect[symbol] = valence
#     return nelect


# Path: pyDFTutils/vasp/bader.py
from .vasp_utils import get_electrons
from pyDFTutils.ase_utils.chemsymbol import get_symdict
from ase.io import read
import matplotlib.pyplot as plt
import os
import numpy as np
    import re

#! /usr/bin/env python

def run_bader(filename='CHGCAR'):
    if os.path.exists('AECCAR0') and os.path.exists('AECCAR2'):
        if not os.path.exists('CHGCAR_sum'):

            os.system('chgsum AECCAR0 AECCAR2')