# Path: vasppy/procar.py
# class KPoint():
# class Procar:
#     def __init__( self, index, frac_coords, weight ):
#     def cart_coords( self, reciprocal_lattice ):
#     def __eq__( self, other ):
#     def __repr__( self ):
# def get_numbers_from_string( string ):
# def k_point_parser( string ):
# def projections_parser( string ):
# def area_of_a_triangle_in_cartesian_space( a, b, c ):
# def points_are_in_a_straight_line( points, tolerance=1e-7 ):
# def two_point_effective_mass( cartesian_k_points, eigenvalues ):
# def least_squares_effective_mass( cartesian_k_points, eigenvalues ):
#     def __init__( self, spin=1, negative_occupancies='warn' ):
#     def occupancy( self ):
#     def __add__( self, other ):
#     def parse_projections( self ):
#     def parse_k_points( self ):
#     def parse_bands( self ):
#     def sanity_check( self ):
#     def from_files( cls, filenames, **kwargs ):
#     def from_file( cls, filename, negative_occupancies='warn',
#                    select_zero_weighted_k_points=False ):
#     def read_from_file( self, filename ):
#     def _read_from_file( self, filename ):
#     def number_of_k_points( self ):
#     def number_of_bands( self ):
#     def spin_channels( self ):
#     def number_of_ions( self ):
#     def number_of_projections( self ):
#     def print_weighted_band_structure( self, spins=None, ions=None, orbitals=None, scaling=1.0, e_fermi=0.0, reciprocal_lattice=None ):
#     def weighted_band_structure( self, spins=None, ions=None, orbitals=None, scaling=1.0, e_fermi=0.0, reciprocal_lattice=None ):
#     def effective_mass_calc( self, k_point_indices, band_index, reciprocal_lattice, spin=1, printing=False ):
#     def x_axis( self, reciprocal_lattice=None ):
#     def bands( self ):
#     def k_points( self ):
#     def select_bands_by_kpoint( self, band_indices ):
#     def select_k_points( self, band_indices ):


import unittest
import os
import numpy as np
import warnings
from vasppy import procar
from unittest.mock import patch, call
from copy import deepcopy
        with warnings.catch_warnings():
            warnings.simplefilter('ignore')
            pcar._read_from_file( test_procar_filename )
        np.testing.assert_equal( [ b.index for b in pcar._bands ], 
                                 [ 1., 2., 3., 4., 1., 2., 3., 4. ] )
        np.testing.assert_equal( [ b.energy for b in pcar._bands ], 
                                 [ -13.17934476,
                                   -13.17934476,
                                   -13.16936722,
                                   -13.16936722,
                                   -13.1849117 ,
                                   -13.1849117 ,
                                   -13.16621473,
                                   -13.16621472] )
        np.testing.assert_equal( [ b.occupancy for b in pcar._bands ],
                                 [ 1., 1., 1., 1., 1., 1., 1., -0.03191968 ] )

    def test_spin_polarised_procar_is_read_from_file( self ):
        """Checking that `PROCAR_spin_polarised_test` is read"""
        pcar = procar.Procar()
        with warnings.catch_warnings():
            warnings.simplefilter('ignore')
            pcar._read_from_file( test_procar_spin_polarised_filename )
        self.assertEqual( pcar.spin_channels, 2 )
        self.assertEqual( pcar.number_of_ions, 25 )
        self.assertEqual( pcar.number_of_bands, 112 )
        self.assertEqual( pcar.number_of_k_points, 8 )
        
    def test___add___( self ):
        pcar1 = procar.Procar()

# Path: vasppy/procar.py
# class KPoint():
# class Procar:
#     def __init__( self, index, frac_coords, weight ):
#     def cart_coords( self, reciprocal_lattice ):
#     def __eq__( self, other ):
#     def __repr__( self ):
# def get_numbers_from_string( string ):
# def k_point_parser( string ):
# def projections_parser( string ):
# def area_of_a_triangle_in_cartesian_space( a, b, c ):
# def points_are_in_a_straight_line( points, tolerance=1e-7 ):
# def two_point_effective_mass( cartesian_k_points, eigenvalues ):
# def least_squares_effective_mass( cartesian_k_points, eigenvalues ):
#     def __init__( self, spin=1, negative_occupancies='warn' ):
#     def occupancy( self ):
#     def __add__( self, other ):
#     def parse_projections( self ):
#     def parse_k_points( self ):
#     def parse_bands( self ):
#     def sanity_check( self ):
#     def from_files( cls, filenames, **kwargs ):
#     def from_file( cls, filename, negative_occupancies='warn',
#                    select_zero_weighted_k_points=False ):
#     def read_from_file( self, filename ):
#     def _read_from_file( self, filename ):
#     def number_of_k_points( self ):
#     def number_of_bands( self ):
#     def spin_channels( self ):
#     def number_of_ions( self ):
#     def number_of_projections( self ):
#     def print_weighted_band_structure( self, spins=None, ions=None, orbitals=None, scaling=1.0, e_fermi=0.0, reciprocal_lattice=None ):
#     def weighted_band_structure( self, spins=None, ions=None, orbitals=None, scaling=1.0, e_fermi=0.0, reciprocal_lattice=None ):
#     def effective_mass_calc( self, k_point_indices, band_index, reciprocal_lattice, spin=1, printing=False ):
#     def x_axis( self, reciprocal_lattice=None ):
#     def bands( self ):
#     def k_points( self ):
#     def select_bands_by_kpoint( self, band_indices ):
#     def select_k_points( self, band_indices ):


# Path: tests/test_procar.py
import unittest
import os
import numpy as np
import warnings
from vasppy import procar
from unittest.mock import patch, call
from copy import deepcopy

        with warnings.catch_warnings():
            warnings.simplefilter('ignore')
            pcar._read_from_file( test_procar_filename )
        np.testing.assert_equal( [ b.index for b in pcar._bands ], 
                                 [ 1., 2., 3., 4., 1., 2., 3., 4. ] )
        np.testing.assert_equal( [ b.energy for b in pcar._bands ], 
                                 [ -13.17934476,
                                   -13.17934476,
                                   -13.16936722,
                                   -13.16936722,
                                   -13.1849117 ,
                                   -13.1849117 ,
                                   -13.16621473,
                                   -13.16621472] )
        np.testing.assert_equal( [ b.occupancy for b in pcar._bands ],
                                 [ 1., 1., 1., 1., 1., 1., 1., -0.03191968 ] )

    def test_spin_polarised_procar_is_read_from_file( self ):
        """Checking that `PROCAR_spin_polarised_test` is read"""
        pcar = procar.Procar()
        with warnings.catch_warnings():
            warnings.simplefilter('ignore')
            pcar._read_from_file( test_procar_spin_polarised_filename )
        self.assertEqual( pcar.spin_channels, 2 )
        self.assertEqual( pcar.number_of_ions, 25 )
        self.assertEqual( pcar.number_of_bands, 112 )
        self.assertEqual( pcar.number_of_k_points, 8 )
        
    def test___add___( self ):
        pcar1 = procar.Procar()

        pcar2 = procar.Procar()