# Path: pyDFTutils/ase_utils/kpoints.py
# def cubic_kpath(npoints=500,name=True):
#     """
#     return the kpoint path for cubic
#     Parameters:
#     ----------------
#     npoints: int
#         number of points.
# 
#     Returns:
#     -----------------
#     kpts:
#         kpoints
#     xs:
#         x cordinates for plot
#     xspecial:
#         x cordinates for special k points
#     """
#     special_path = special_paths['cubic']
#     points = special_points['cubic']
#     paths = parse_path_string(special_path)
#     special_kpts = [points[k] for k in paths[0]]
#     kpts, xs, xspecial = bandpath(
#         special_kpts, cell=np.eye(3), npoints=npoints)
#     if not name:
#         return kpts, xs, xspecial
#     else:
#         return kpts, xs, xspecial,special_path


from netCDF4 import Dataset
from matplotlib.collections import LineCollection
from matplotlib.colors import colorConverter
from ase.units import Bohr
from pyDFTutils.ase_utils.kpoints import cubic_kpath
from collections import namedtuple
import numpy as np
import matplotlib.pyplot as plt
import os.path
    phfreqs = ds.variables['phfreqs'][:] * 8065.6
    phdisps = ds.variables['phdispl_cart'][:]
    masses = ds.variables['atomic_mass_units'][:]
    masses = list(masses) + [masses[-1]] * 2

    IR_modes = label_all(qpoints, phfreqs, phdisps, masses)
    #return

    print((phdisps[0, 0, :, :] / Bohr))
    print((phdisps[0, 0, :, 0] / Bohr))
    print((get_weight(phdisps[0, 0, :, :], masses)))
    phfreqs = fix_gamma(qpoints, phfreqs)

    weights_A = np.empty_like(phfreqs)
    weights_B = np.empty_like(phfreqs)
    weights_C = np.empty_like(phfreqs)

    nk, nm = phfreqs.shape

    for i in range(nk):
        for j in range(nm):
            weights_A[i, j], weights_B[i, j], weights_C[i, j] = get_weight(
                phdisps[i, j, :, :], masses)

    #for i in range(1):
    # plt.plot(weights_B[:, i], linewidth=0.1, color='gray')
    #plt.plot(weights_A[:, i], linewidth=0.1, color='gray')
    #plt.show()
    #return
    axis = None

# Path: pyDFTutils/ase_utils/kpoints.py
# def cubic_kpath(npoints=500,name=True):
#     """
#     return the kpoint path for cubic
#     Parameters:
#     ----------------
#     npoints: int
#         number of points.
# 
#     Returns:
#     -----------------
#     kpts:
#         kpoints
#     xs:
#         x cordinates for plot
#     xspecial:
#         x cordinates for special k points
#     """
#     special_path = special_paths['cubic']
#     points = special_points['cubic']
#     paths = parse_path_string(special_path)
#     special_kpts = [points[k] for k in paths[0]]
#     kpts, xs, xspecial = bandpath(
#         special_kpts, cell=np.eye(3), npoints=npoints)
#     if not name:
#         return kpts, xs, xspecial
#     else:
#         return kpts, xs, xspecial,special_path


# Path: pyDFTutils/phonon/plotphon.py
from netCDF4 import Dataset
from matplotlib.collections import LineCollection
from matplotlib.colors import colorConverter
from ase.units import Bohr
from pyDFTutils.ase_utils.kpoints import cubic_kpath
from collections import namedtuple
import numpy as np
import matplotlib.pyplot as plt
import os.path

    phfreqs = ds.variables['phfreqs'][:] * 8065.6
    phdisps = ds.variables['phdispl_cart'][:]
    masses = ds.variables['atomic_mass_units'][:]
    masses = list(masses) + [masses[-1]] * 2

    IR_modes = label_all(qpoints, phfreqs, phdisps, masses)
    #return

    print((phdisps[0, 0, :, :] / Bohr))
    print((phdisps[0, 0, :, 0] / Bohr))
    print((get_weight(phdisps[0, 0, :, :], masses)))
    phfreqs = fix_gamma(qpoints, phfreqs)

    weights_A = np.empty_like(phfreqs)
    weights_B = np.empty_like(phfreqs)
    weights_C = np.empty_like(phfreqs)

    nk, nm = phfreqs.shape

    for i in range(nk):
        for j in range(nm):
            weights_A[i, j], weights_B[i, j], weights_C[i, j] = get_weight(
                phdisps[i, j, :, :], masses)

    #for i in range(1):
    # plt.plot(weights_B[:, i], linewidth=0.1, color='gray')
    #plt.plot(weights_A[:, i], linewidth=0.1, color='gray')
    #plt.show()
    #return
    axis = None

    kpath = cubic_kpath()