# Path: pyDFTutils/vasp/vasp_utils.py
# def read_poscar_and_unsort(filename='CONTCAR'):
#     """
#     read poscar and unsort. return the symbols,positions and cell in unsorted order.
#     """
#     atoms = read_vasp(filename)
#     symbols = get_unsorted(atoms.get_chemical_symbols())
#     positions = get_unsorted(atoms.get_positions())
#     cell = atoms.get_cell()
#     return symbols, positions, cell
# 
# Path: pyDFTutils/ase_utils/symbol.py
# def symbol_number(symbols):
#     """
#     symbols can be also atoms. Thus the chemical symbols will be used.
#     Fe Fe Fe O -> {Fe1:0 Fe2:1 Fe3:2 O1:3}
#     """
#     try:
#         symbs=symbols.copy().get_chemical_symbols()
#     except Exception:
#         symbs=symbols
#     symdict={}
#     result=OrderedDict()
#     for i,sym in enumerate(symbs):
#         if sym in symdict:
#             symdict[sym]=symdict[sym]+1
#         else:
#             symdict[sym]=1
#         result[sym+str(symdict[sym])]=i
#     return result


from pyDFTutils.vasp.vasp_utils import read_poscar_and_unsort
from ase.calculators.vasp import Vasp, Vasp2
from ase.dft.kpoints import get_bandpath
from os.path import join
from ase.utils import devnull, basestring
from pyDFTutils.ase_utils.symbol import symbol_number
from shutil import copyfile, move
import ase.calculators.vasp.create_input
import matplotlib.pyplot as plt
import os
import sys
import numpy as np
import tempfile
import ase.io
import socket
#! /usr/bin/env python

if 'maskcell' not in ase.calculators.vasp.create_input.int_keys:
    ase.calculators.vasp.create_input.int_keys.append('maskcell')

default_pps_1 = {
    'Pr': 'Pr_3',
    'Ni': 'Ni',
    'Yb': 'Yb_3',
    'Pd': 'Pd',
    'Pt': 'Pt',
    'Ru': 'Ru_pv',
    'S': 'S',
    'Na': 'Na_pv',
    'Nb': 'Nb_sv',
    'Nd': 'Nd_3',
    'C': 'C',
    'Li': 'Li_sv',
    'Pb': 'Pb_d',
    'Y': 'Y_sv',
    'Tl': 'Tl_d',
    'Lu': 'Lu_3',
    'Rb': 'Rb_sv',
    'Ti': 'Ti_sv',
    'Te': 'Te',

# Path: pyDFTutils/vasp/vasp_utils.py
# def read_poscar_and_unsort(filename='CONTCAR'):
#     """
#     read poscar and unsort. return the symbols,positions and cell in unsorted order.
#     """
#     atoms = read_vasp(filename)
#     symbols = get_unsorted(atoms.get_chemical_symbols())
#     positions = get_unsorted(atoms.get_positions())
#     cell = atoms.get_cell()
#     return symbols, positions, cell
# 
# Path: pyDFTutils/ase_utils/symbol.py
# def symbol_number(symbols):
#     """
#     symbols can be also atoms. Thus the chemical symbols will be used.
#     Fe Fe Fe O -> {Fe1:0 Fe2:1 Fe3:2 O1:3}
#     """
#     try:
#         symbs=symbols.copy().get_chemical_symbols()
#     except Exception:
#         symbs=symbols
#     symdict={}
#     result=OrderedDict()
#     for i,sym in enumerate(symbs):
#         if sym in symdict:
#             symdict[sym]=symdict[sym]+1
#         else:
#             symdict[sym]=1
#         result[sym+str(symdict[sym])]=i
#     return result


# Path: pyDFTutils/vasp/myvasp.py
from pyDFTutils.vasp.vasp_utils import read_poscar_and_unsort
from ase.calculators.vasp import Vasp, Vasp2
from ase.dft.kpoints import get_bandpath
from os.path import join
from ase.utils import devnull, basestring
from pyDFTutils.ase_utils.symbol import symbol_number
from shutil import copyfile, move
import ase.calculators.vasp.create_input
import matplotlib.pyplot as plt
import os
import sys
import numpy as np
import tempfile
import ase.io
import socket

#! /usr/bin/env python

if 'maskcell' not in ase.calculators.vasp.create_input.int_keys:
    ase.calculators.vasp.create_input.int_keys.append('maskcell')

default_pps_1 = {
    'Pr': 'Pr_3',
    'Ni': 'Ni',
    'Yb': 'Yb_3',
    'Pd': 'Pd',
    'Pt': 'Pt',
    'Ru': 'Ru_pv',
    'S': 'S',
    'Na': 'Na_pv',
    'Nb': 'Nb_sv',
    'Nd': 'Nd_3',
    'C': 'C',
    'Li': 'Li_sv',
    'Pb': 'Pb_d',
    'Y': 'Y_sv',
    'Tl': 'Tl_d',
    'Lu': 'Lu_3',
    'Rb': 'Rb_sv',
    'Ti': 'Ti_sv',
    'Te': 'Te',

    'Rh': 'Rh_pv',