# Path: orbkit/grid.py
# def grid_init(is_vector=False, force=False):
# def get_grid(start='\t'):
# def tolist():
# def todict():
# def get_shape():
# def set_grid(xnew,ynew,znew,is_vector):
# def set_boundaries(is_regular,Nx=None,Ny=None,Nz=None):
# def get_bbox():
# def grid2vector():
# def vector2grid(Nx,Ny,Nz):
# def matrix_grid2vector(matrix): 
# def matrix_vector2grid(matrix,Nx=None,Ny=None,Nz=None): 
# def mv2g(**kwargs):
# def grid_sym_op(symop):
# def grid_translate(dx,dy,dz):
# def rot(ang,axis):
# def reflect(plane):
# def inversion():
# def sph2cart_vector(r,theta,phi):
# def cyl2cart_vector(r,phi,zed):
# def random_grid(geo_spec,N=1e6,scale=0.5):
# def read(filename, comment='#'):
#   def check(i, is_vector):
# def adjust_to_geo(qc,extend=5.0,step=0.1):
# def check_atom_select(atom,geo_info,geo_spec,interactive=True,
#                       display=sys.stdout.write):
# def center_grid(ac,display=sys.stdout.write):
# def reset_grid():
#   N_ = [len(x),len(y),len(z)]
#     N_ = [Nx,Ny,Nz]
#   P=[numpy.zeros((3,1)), numpy.reshape(ac,(3,1))]
#   N_   = [len(grid[0]), len(grid[1]), len(grid[2])]
#   N_   = [ 101,  101,  101]
# N_   = [ 101,  101,  101]   #: Specifies the number of grid points (regular grid).


import os
import sys
  import optparse
        import h5py
from copy import deepcopy
from orbkit import grid
    from orbkit.test import test
  
    fid : string
      Specifies filename of the requested file.
    what : string, optional
      Describes the file.
    error : function, optional
      Handles the errors.
    display :  function, optional
      Handles the print commands.
    interactive : bool, optional
      If True and a file does not exist, asks the user to insert name of 
      existing file.
  
  **Returns:**
  
    fid : string
      Specifies filename of the requested file.
  '''
  
  while not (isinstance(fid,str) and os.path.exists(fid)): 
    if fid != '':
      display('%s does not exist!\n' % fid)
    if interactive:
      fid = input('Please insert a correct %s: ' % what)
    else:
      error('Insert a correct %s!\n' % what)
      break 
  return fid

def check_grid_output_compatibilty(error=raise_error): 

# Path: orbkit/grid.py
# def grid_init(is_vector=False, force=False):
# def get_grid(start='\t'):
# def tolist():
# def todict():
# def get_shape():
# def set_grid(xnew,ynew,znew,is_vector):
# def set_boundaries(is_regular,Nx=None,Ny=None,Nz=None):
# def get_bbox():
# def grid2vector():
# def vector2grid(Nx,Ny,Nz):
# def matrix_grid2vector(matrix): 
# def matrix_vector2grid(matrix,Nx=None,Ny=None,Nz=None): 
# def mv2g(**kwargs):
# def grid_sym_op(symop):
# def grid_translate(dx,dy,dz):
# def rot(ang,axis):
# def reflect(plane):
# def inversion():
# def sph2cart_vector(r,theta,phi):
# def cyl2cart_vector(r,phi,zed):
# def random_grid(geo_spec,N=1e6,scale=0.5):
# def read(filename, comment='#'):
#   def check(i, is_vector):
# def adjust_to_geo(qc,extend=5.0,step=0.1):
# def check_atom_select(atom,geo_info,geo_spec,interactive=True,
#                       display=sys.stdout.write):
# def center_grid(ac,display=sys.stdout.write):
# def reset_grid():
#   N_ = [len(x),len(y),len(z)]
#     N_ = [Nx,Ny,Nz]
#   P=[numpy.zeros((3,1)), numpy.reshape(ac,(3,1))]
#   N_   = [len(grid[0]), len(grid[1]), len(grid[2])]
#   N_   = [ 101,  101,  101]
# N_   = [ 101,  101,  101]   #: Specifies the number of grid points (regular grid).


# Path: orbkit/options.py
import os
import sys
  import optparse
        import h5py
from copy import deepcopy
from orbkit import grid
    from orbkit.test import test

  
    fid : string
      Specifies filename of the requested file.
    what : string, optional
      Describes the file.
    error : function, optional
      Handles the errors.
    display :  function, optional
      Handles the print commands.
    interactive : bool, optional
      If True and a file does not exist, asks the user to insert name of 
      existing file.
  
  **Returns:**
  
    fid : string
      Specifies filename of the requested file.
  '''
  
  while not (isinstance(fid,str) and os.path.exists(fid)): 
    if fid != '':
      display('%s does not exist!\n' % fid)
    if interactive:
      fid = input('Please insert a correct %s: ' % what)
    else:
      error('Insert a correct %s!\n' % what)
      break 
  return fid

def check_grid_output_compatibilty(error=raise_error): 

  if not grid.is_regular and ('cube'   in otype or 