class_docstr: This class implements the featurization to implement Weave convolutions.
  
  Weave convolutions were introduced in [1]_. Unlike Duvenaud graph
  convolutions, weave convolutions require a quadratic matrix of interaction
  descriptors for each pair of atoms. These extra descriptors may provide for
  additional descriptive power but at the cost of a larger featurized dataset.
  
  
  Examples
  --------
  >>> import deepchem as dc
  >>> mols = ["CCC"]
  >>> featurizer = dc.feat.WeaveFeaturizer()
  >>> features = featurizer.featurize(mols)
  >>> type(features[0])
  <class 'deepchem.feat.mol_graphs.WeaveMol'>
  >>> features[0].get_num_atoms() # 3 atoms in compound
  3
  >>> features[0].get_num_features() # feature size
  75
  >>> type(features[0].get_atom_features())
  <class 'numpy.ndarray'>
  >>> features[0].get_atom_features().shape
  (3, 75)
  >>> type(features[0].get_pair_features())
  <class 'numpy.ndarray'>
  >>> features[0].get_pair_features().shape
  (9, 14)
  
  
  References
  ----------
  .. [1] Kearnes, Steven, et al. "Molecular graph convolutions: moving beyond
      fingerprints." Journal of computer-aided molecular design 30.8 (2016):
      595-608.
  
  Note
  ----
  This class requires RDKit to be installed.
docstr: Initialize this featurizer with set parameters.
  
  Parameters
  ----------
  graph_distance: bool, (default True)
      If True, use graph distance for distance features. Otherwise, use
      Euclidean distance. Note that this means that molecules that this
      featurizer is invoked on must have valid conformer information if this
      option is set.
  explicit_H: bool, (default False)
      If true, model hydrogens in the molecule.
  use_chirality: bool, (default False)
      If true, use chiral information in the featurization
  max_pair_distance: Optional[int], (default None)
      This value can be a positive integer or None. This
      parameter determines the maximum graph distance at which pair
      features are computed. For example, if `max_pair_distance==2`,
      then pair features are computed only for atoms at most graph
      distance 2 apart. If `max_pair_distance` is `None`, all pairs are
      considered (effectively infinite `max_pair_distance`)
docstr_tok: ["Initialize","this","featurizer","with","set","parameters",".","Parameters","--","--","--","--","--","graph_distance",":","bool",",","(","default","True",")","If","True",",","use","graph","distance","for","distance","features",".","Otherwise",",","use","Euclidean","distance",".","Note","that","this","means","that","molecules","that","this","featurizer","is","invoked","on","must","have","valid","conformer","information","if","this","option","is","set",".","explicit_H",":","bool",",","(","default","False",")","If","true",",","model","hydrogens","in","the","molecule",".","use_chirality",":","bool",",","(","default","False",")","If","true",",","use","chiral","information","in","the","featurization","max_pair_distance",":","Optional","[","int","]",",","(","default","None",")","This","value","can","be","a","positive","integer","or","None",".","This","parameter","determines","the","maximum","graph","distance","at","which","pair","features","are","computed",".","For","example",",","if","`","max_pair_distance==2","`",",","then","pair","features","are","computed","only","for","atoms","at","most","graph","distance","2","apart",".","If","`","max_pair_distance","`","is","`","None","`",",","all","pairs","are","considered","(","effectively","infinite","`","max_pair_distance","`",")"]
code: def __init__(
      self,
      graph_distance: bool = True,
      explicit_H: bool = False,
      use_chirality: bool = False,
      max_pair_distance: Optional[int] = None,
  ):
      """Initialize this featurizer with set parameters.
  
      Parameters
      ----------
      graph_distance: bool, (default True)
          If True, use graph distance for distance features. Otherwise, use
          Euclidean distance. Note that this means that molecules that this
          featurizer is invoked on must have valid conformer information if this
          option is set.
      explicit_H: bool, (default False)
          If true, model hydrogens in the molecule.
      use_chirality: bool, (default False)
          If true, use chiral information in the featurization
      max_pair_distance: Optional[int], (default None)
          This value can be a positive integer or None. This
          parameter determines the maximum graph distance at which pair
          features are computed. For example, if `max_pair_distance==2`,
          then pair features are computed only for atoms at most graph
          distance 2 apart. If `max_pair_distance` is `None`, all pairs are
          considered (effectively infinite `max_pair_distance`)
      """
      # Distance is either graph distance(True) or Euclidean distance(False,
      # only support datasets providing Cartesian coordinates)
      self.graph_distance = graph_distance
      # Set dtype
      self.dtype = object
      # If includes explicit hydrogens
      self.explicit_H = explicit_H
      # If uses use_chirality
      self.use_chirality = use_chirality
      if isinstance(max_pair_distance, int) and max_pair_distance <= 0:
          raise ValueError(
              "max_pair_distance must either be a positive integer or None"
          )
      self.max_pair_distance = max_pair_distance
      if self.use_chirality:
          self.bt_len = int(GraphConvConstants.bond_fdim_base) + len(
              GraphConvConstants.possible_bond_stereo
          )
      else:
          self.bt_len = int(GraphConvConstants.bond_fdim_base)
  
imports: import numpy
  import deepchem
  from deepchem.feat.base_classes import MolecularFeaturizer
  from deepchem.feat.mol_graphs import ConvMol, WeaveMol
  from deepchem.data import DiskDataset
  import logging
  from typing import Optional, List, Tuple, Union, Iterable
  from deepchem.utils.typing import RDKitMol, RDKitAtom
  from deepchem.utils.molecule_feature_utils import one_hot_encode
label_desc: Use image node_id 1 to create a new WeaveFeaturizer object from inherited base classes: MolecularFeaturizer with example: obj = WeaveFeaturizer(graph_distance, explicit_H, use_chirality, max_pair_distance)