class_docstr: Localize cation-Pi interactions between atoms in macromolecular complexes.
  
  Given a macromolecular complex made up of multiple
  constitutent molecules, compute cation-Pi between atoms in
  the macromolecular complex. For each atom, localize this salt
  bridge in the voxel in which it originated to create a local
  cation-pi array.
  
  Let `voxels_per_edge = int(box_width/voxel_width)`.  Creates a
  tensor output of shape `(voxels_per_edge, voxels_per_edge,
  voxels_per_edge, 1)` for each macromolecular complex that counts the
  number of cation-pi interactions at each voxel.
class_docstr_tok: ["Localize","cation-Pi","interactions","between","atoms","in","macromolecular","complexes",".","Given","a","macromolecular","complex","made","up","of","multiple","constitutent","molecules",",","compute","cation-Pi","between","atoms","in","the","macromolecular","complex",".","For","each","atom",",","localize","this","salt","bridge","in","the","voxel","in","which","it","originated","to","create","a","local","cation-pi","array",".","Let","`","voxels_per_edge","=","int","(","box_width\/voxel_width",")","`",".","Creates","a","tensor","output","of","shape","`","(","voxels_per_edge",",","voxels_per_edge",",","voxels_per_edge",",","1",")","`","for","each","macromolecular","complex","that","counts","the","number","of","cation-pi","interactions","at","each","voxel","."]
docstr: Parameters
  ----------
  cutoff: float, optional (default 6.5)
      The distance in angstroms within which atoms must be to
      be considered for a cation-pi interaction between them.
  angle_cutoff: float, optional (default 30.0)
      Angle cutoff. Max allowed deviation from the ideal (0deg)
      angle between ring normal and vector pointing from ring
      center to cation (in degrees).
  box_width: float, optional (default 16.0)
      Size of a box in which voxel features are calculated. Box
      is centered on a ligand centroid.
  voxel_width: float, optional (default 1.0)
      Size of a 3D voxel in a grid.
code: def __init__(
      self,
      cutoff: float = 6.5,
      angle_cutoff: float = 30.0,
      box_width: float = 16.0,
      voxel_width: float = 1.0,
  ):
      """
      Parameters
      ----------
      cutoff: float, optional (default 6.5)
          The distance in angstroms within which atoms must be to
          be considered for a cation-pi interaction between them.
      angle_cutoff: float, optional (default 30.0)
          Angle cutoff. Max allowed deviation from the ideal (0deg)
          angle between ring normal and vector pointing from ring
          center to cation (in degrees).
      box_width: float, optional (default 16.0)
          Size of a box in which voxel features are calculated. Box
          is centered on a ligand centroid.
      voxel_width: float, optional (default 1.0)
          Size of a 3D voxel in a grid.
      """
      self.cutoff = cutoff
      self.angle_cutoff = angle_cutoff
      self.box_width = box_width
      self.voxel_width = voxel_width
  
imports: import itertools
  import logging
  import numpy
  from deepchem.utils import rdkit_utils
  from deepchem.feat import ComplexFeaturizer
  from deepchem.utils.voxel_utils import voxelize
  from deepchem.utils.voxel_utils import convert_atom_to_voxel
  from deepchem.utils.voxel_utils import convert_atom_pair_to_voxel
  from deepchem.utils.noncovalent_utils import compute_salt_bridges
  from deepchem.utils.noncovalent_utils import compute_binding_pocket_cation_pi
  from deepchem.utils.noncovalent_utils import compute_pi_stack
  from deepchem.utils.noncovalent_utils import compute_hydrogen_bonds
  from deepchem.utils.rdkit_utils import MoleculeLoadException
  from deepchem.utils.rdkit_utils import compute_contact_centroid
  from deepchem.utils.geometry_utils import compute_pairwise_distances
  from deepchem.utils.geometry_utils import subtract_centroid
  from deepchem.utils.fragment_utils import get_partial_charge
  from deepchem.utils.fragment_utils import reduce_molecular_complex_to_contacts
  from typing import List, Tuple, Optional
label_desc: Use image node_id 1 to create a new CationPiVoxelizer object from inherited base classes: ComplexFeaturizer with example: obj = CationPiVoxelizer(cutoff, angle_cutoff, box_width, voxel_width)