# 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
            print( ''.join( ['   {: .10f}'.format( element ) for element in row ] ) )
        print( ' '.join( self.atoms ) )
        print( ' '.join( [ str(n) for n in self.atom_numbers ] ) )
        if opts.get('selective'):
            print( 'Selective Dynamics' )
        print( coordinate_type )

    def write_to( self, filename, coordinate_type='Direct', opts=None ):
        if opts is None:
            opts = {}
        with open( filename, 'w' ) as sys.stdout:
            self.output( coordinate_type=coordinate_type, opts=opts )
        sys.stdout = sys.__stdout__ # make sure sys.stdout is reset
        
    def output_as_xtl( self ):
        print( self.title )
        print( "CELL" )
        cell_lengths = self.cell_lengths()
        cell_angles  = self.cell_angles()
        cell_data = cell_lengths + cell_angles
        print( ''.join( ['   {: .8f}'.format( element ) for element in cell_data ] ) )
        print( " Symmetry label P1\n\nATOMS\nNAME      X       Y     Z" )
        output_opts = { 'label' : True }
        self.output_coordinates_only( coordinate_type='Direct', opts = output_opts )

    def output_as_cif( self, symprec = None ):
        print( CifWriter( self.to_pymatgen_structure(), symprec ) )

    def output_as_pimaim( self, to_bohr = True ):
        if to_bohr is True:

# 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

            print( ''.join( ['   {: .10f}'.format( element ) for element in row ] ) )
        print( ' '.join( self.atoms ) )
        print( ' '.join( [ str(n) for n in self.atom_numbers ] ) )
        if opts.get('selective'):
            print( 'Selective Dynamics' )
        print( coordinate_type )

    def write_to( self, filename, coordinate_type='Direct', opts=None ):
        if opts is None:
            opts = {}
        with open( filename, 'w' ) as sys.stdout:
            self.output( coordinate_type=coordinate_type, opts=opts )
        sys.stdout = sys.__stdout__ # make sure sys.stdout is reset
        
    def output_as_xtl( self ):
        print( self.title )
        print( "CELL" )
        cell_lengths = self.cell_lengths()
        cell_angles  = self.cell_angles()
        cell_data = cell_lengths + cell_angles
        print( ''.join( ['   {: .8f}'.format( element ) for element in cell_data ] ) )
        print( " Symmetry label P1\n\nATOMS\nNAME      X       Y     Z" )
        output_opts = { 'label' : True }
        self.output_coordinates_only( coordinate_type='Direct', opts = output_opts )

    def output_as_cif( self, symprec = None ):
        print( CifWriter( self.to_pymatgen_structure(), symprec ) )

    def output_as_pimaim( self, to_bohr = True ):
        if to_bohr is True:

            unit_scaling = angstrom_to_bohr