# Path: vasppy/configuration.py
# class Configuration:
#     def __init__( self, cell, atoms ):
#     def dr( self, atom1, atom2 ):
#     def minimum_image_dr( self, atom1, atom2, cutoff=None ):
#     def interatomic_distances( self, minimum_image_convention = True ):
#     def interatomic_distances_for_atom( self, atom1, minimum_image_convention = True ):
#     def atoms_with_label( self, label ):
#     def partial_rdf( self, spec_i, spec_j, max_r, number_of_bins ):
#     def per_atom_rdf( self, spec_i, spec_j, max_r, number_of_bins ):
# 
# Path: vasppy/atom.py
# class Atom:
#     def __init__( self, label, r ): # currently assume fractional coordinates
# 
# Path: vasppy/cell.py
# def angle( x, y ):
# def rotation_matrix(axis, theta):
#     def __init__( self, matrix ):
#     def dr( self, r1, r2, cutoff=None ):
#     def nearest_image( self, origin, point ):
#     def minimum_image( self, r1, r2 ):
#     def minimum_image_dr( self, r1, r2, cutoff=None ):
#     def lengths( self ):
#     def angles( self ):
#     def cartesian_to_fractional_coordinates( self, coordinates ):
#     def fractional_to_cartesian_coordinates( self, coordinates ):
#     def inside_cell( self, r ):
#     def volume( self ):
#     def unit_vectors( self ):
#     def rotate( self, axis, theta ):
# class Cell:
# 
# Path: vasppy/units.py



import numpy as np  # type: ignore
import sys
import re
import copy
from vasppy import configuration, atom, cell
from vasppy.units import angstrom_to_bohr
from pymatgen import Lattice as pmg_Lattice  # type: ignore
from pymatgen import Structure as pmg_Structure  # type: ignore
from pymatgen.io.cif import CifWriter  # type: ignore
from collections import Counter
from signal import signal, SIGPIPE, SIG_DFL
            new_poscar.atom_numbers = [ int( num * h * k * l / 2 ) for num in self.atom_numbers for __ in ( 0, 1 )]
        else:
            new_poscar.atoms = self.atoms
            new_poscar.atom_numbers = [ num * h * k * l for num in self.atom_numbers ]
        # generate grouped / ungrouped atoms coordinates for supercell
        if group:
            for row in self.coordinates:
                pos_in_origin_cell = row / lattice_scaling
                for odd_even in ( 0, 1 ):
                    for ( a, b, c ) in [ cell_shift for cell_shift in cell_shift_indices if parity(cell_shift) == odd_even ]:
                        new_coordinate_list.append( [ pos_in_origin_cell + np.array( [ a, b, c ] * lattice_shift ) ][0].tolist() )
        else:
            for row in self.coordinates:
                pos_in_origin_cell = row / lattice_scaling
                for ( a, b, c ) in cell_shift_indices:
                    new_coordinate_list.append( [ pos_in_origin_cell + np.array( [ a, b, c ] * lattice_shift ) ][0].tolist() )
        new_poscar.coordinates = np.array( new_coordinate_list )
        return new_poscar    

    def cell_lengths( self ):
        return( ( self.cell.lengths() * self.scaling ).tolist() )
        # return [ np.linalg.norm( row ) for row in self.cell.matrix * self.scaling ]

    def cell_angles( self ):
        return( self.cell.angles() )
        # ( a, b, c ) = [ row for row in self.cell.matrix ]
        # return [ angle( b, c ), angle( a, c ), angle( a, b ) ]

    def to_configuration( self ):
        atoms = [ atom.Atom( label, coordinates ) for ( label, coordinates ) in zip( self.labels(), self.fractional_coordinates() ) ]

# Path: vasppy/configuration.py
# class Configuration:
#     def __init__( self, cell, atoms ):
#     def dr( self, atom1, atom2 ):
#     def minimum_image_dr( self, atom1, atom2, cutoff=None ):
#     def interatomic_distances( self, minimum_image_convention = True ):
#     def interatomic_distances_for_atom( self, atom1, minimum_image_convention = True ):
#     def atoms_with_label( self, label ):
#     def partial_rdf( self, spec_i, spec_j, max_r, number_of_bins ):
#     def per_atom_rdf( self, spec_i, spec_j, max_r, number_of_bins ):
# 
# Path: vasppy/atom.py
# class Atom:
#     def __init__( self, label, r ): # currently assume fractional coordinates
# 
# Path: vasppy/cell.py
# def angle( x, y ):
# def rotation_matrix(axis, theta):
#     def __init__( self, matrix ):
#     def dr( self, r1, r2, cutoff=None ):
#     def nearest_image( self, origin, point ):
#     def minimum_image( self, r1, r2 ):
#     def minimum_image_dr( self, r1, r2, cutoff=None ):
#     def lengths( self ):
#     def angles( self ):
#     def cartesian_to_fractional_coordinates( self, coordinates ):
#     def fractional_to_cartesian_coordinates( self, coordinates ):
#     def inside_cell( self, r ):
#     def volume( self ):
#     def unit_vectors( self ):
#     def rotate( self, axis, theta ):
# class Cell:
# 
# Path: vasppy/units.py



# Path: vasppy/poscar.py
import numpy as np  # type: ignore
import sys
import re
import copy
from vasppy import configuration, atom, cell
from vasppy.units import angstrom_to_bohr
from pymatgen import Lattice as pmg_Lattice  # type: ignore
from pymatgen import Structure as pmg_Structure  # type: ignore
from pymatgen.io.cif import CifWriter  # type: ignore
from collections import Counter
from signal import signal, SIGPIPE, SIG_DFL

            new_poscar.atom_numbers = [ int( num * h * k * l / 2 ) for num in self.atom_numbers for __ in ( 0, 1 )]
        else:
            new_poscar.atoms = self.atoms
            new_poscar.atom_numbers = [ num * h * k * l for num in self.atom_numbers ]
        # generate grouped / ungrouped atoms coordinates for supercell
        if group:
            for row in self.coordinates:
                pos_in_origin_cell = row / lattice_scaling
                for odd_even in ( 0, 1 ):
                    for ( a, b, c ) in [ cell_shift for cell_shift in cell_shift_indices if parity(cell_shift) == odd_even ]:
                        new_coordinate_list.append( [ pos_in_origin_cell + np.array( [ a, b, c ] * lattice_shift ) ][0].tolist() )
        else:
            for row in self.coordinates:
                pos_in_origin_cell = row / lattice_scaling
                for ( a, b, c ) in cell_shift_indices:
                    new_coordinate_list.append( [ pos_in_origin_cell + np.array( [ a, b, c ] * lattice_shift ) ][0].tolist() )
        new_poscar.coordinates = np.array( new_coordinate_list )
        return new_poscar    

    def cell_lengths( self ):
        return( ( self.cell.lengths() * self.scaling ).tolist() )
        # return [ np.linalg.norm( row ) for row in self.cell.matrix * self.scaling ]

    def cell_angles( self ):
        return( self.cell.angles() )
        # ( a, b, c ) = [ row for row in self.cell.matrix ]
        # return [ angle( b, c ), angle( a, c ), angle( a, b ) ]

    def to_configuration( self ):
        atoms = [ atom.Atom( label, coordinates ) for ( label, coordinates ) in zip( self.labels(), self.fractional_coordinates() ) ]

        config = configuration.Configuration( cell.Cell( matrix = self.cell.matrix * self.scaling ), atoms )