class_docstr: Localize hydrogen bonds between atoms in macromolecular complexes.
  
  Given a macromolecular complex made up of multiple
  constitutent molecules, compute hydrogen bonds between atoms
  in the macromolecular complex. For each atom, localize this
  hydrogen bond in the voxel in which it originated to create a
  local hydrogen bond array. Note that if atoms in two
  different voxels interact in a hydrogen bond, the interaction
  is double counted in both voxels.
  
  Let `voxels_per_edge = int(box_width/voxel_width)`.  Creates a
  tensor output of shape `(voxels_per_edge, voxels_per_edge,
  voxels_per_edge, 3)` (assuming the default for `distance_bins` which
  has 3 bins) for each macromolecular complex that counts the number
  of hydrogen bonds at each voxel.
class_docstr_tok: ["Localize","hydrogen","bonds","between","atoms","in","macromolecular","complexes",".","Given","a","macromolecular","complex","made","up","of","multiple","constitutent","molecules",",","compute","hydrogen","bonds","between","atoms","in","the","macromolecular","complex",".","For","each","atom",",","localize","this","hydrogen","bond","in","the","voxel","in","which","it","originated","to","create","a","local","hydrogen","bond","array",".","Note","that","if","atoms","in","two","different","voxels","interact","in","a","hydrogen","bond",",","the","interaction","is","double","counted","in","both","voxels",".","Let","`","voxels_per_edge","=","int","(","box_width\/voxel_width",")","`",".","Creates","a","tensor","output","of","shape","`","(","voxels_per_edge",",","voxels_per_edge",",","voxels_per_edge",",","3",")","`","(","assuming","the","default","for","`","distance_bins","`","which","has","3","bins",")","for","each","macromolecular","complex","that","counts","the","number","of","hydrogen","bonds","at","each","voxel","."]
docstr: Parameters
  ----------
  cutoff: float (default 4.5)
      Distance cutoff in angstroms for contact atoms in complex.
  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.
  reduce_to_contacts: bool, optional
      If True, reduce the atoms in the complex to those near a contact
      region.
  distance_bins: list[tuple]
      List of hydgrogen bond distance bins. If not specified is
      set to default
      `[(2.2, 2.5), (2.5, 3.2), (3.2, 4.0)]`.
  angle_cutoffs: list[float]
      List of hydrogen bond angle cutoffs. Max allowed
      deviation from the ideal (180 deg) angle between
      hydrogen-atom1, hydrogen-atom2 vectors.If not specified
      is set to default `[5, 50, 90]`
code: def __init__(
      self,
      cutoff: float = 4.5,
      box_width: float = 16.0,
      voxel_width: float = 1.0,
      reduce_to_contacts: bool = True,
      distance_bins: Optional[List[Tuple[float, float]]] = None,
      angle_cutoffs: Optional[List[float]] = None,
  ):
      """
      Parameters
      ----------
      cutoff: float (default 4.5)
          Distance cutoff in angstroms for contact atoms in complex.
      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.
      reduce_to_contacts: bool, optional
          If True, reduce the atoms in the complex to those near a contact
          region.
      distance_bins: list[tuple]
          List of hydgrogen bond distance bins. If not specified is
          set to default
          `[(2.2, 2.5), (2.5, 3.2), (3.2, 4.0)]`.
      angle_cutoffs: list[float]
          List of hydrogen bond angle cutoffs. Max allowed
          deviation from the ideal (180 deg) angle between
          hydrogen-atom1, hydrogen-atom2 vectors.If not specified
          is set to default `[5, 50, 90]`
      """
      self.cutoff = cutoff
      if distance_bins is None:
          self.distance_bins = HBOND_DIST_BINS
      else:
          self.distance_bins = distance_bins
      if angle_cutoffs is None:
          self.angle_cutoffs = HBOND_ANGLE_CUTOFFS
      else:
          self.angle_cutoffs = angle_cutoffs
      self.box_width = box_width
      self.voxel_width = voxel_width
      self.reduce_to_contacts = reduce_to_contacts
  
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 HydrogenBondVoxelizer object from inherited base classes: ComplexFeaturizer with example: obj = HydrogenBondVoxelizer(cutoff, box_width, voxel_width, reduce_to_contacts, distance_bins, angle_cutoffs)