class_docstr: Creates a `Dataset` object from SDF input files.
  
  This class provides conveniences to load and featurize data from
  Structure Data Files (SDFs). SDF is a standard format for structural
  information (3D coordinates of atoms and bonds) of molecular compounds.
  
  Examples
  --------
  >>> import deepchem as dc
  >>> import os
  >>> current_dir = os.path.dirname(os.path.realpath(__file__))
  >>> featurizer = dc.feat.CircularFingerprint(size=16)
  >>> loader = dc.data.SDFLoader(["LogP(RRCK)"], featurizer=featurizer, sanitize=True)
  >>> dataset = loader.create_dataset(os.path.join(current_dir, "tests", "membrane_permeability.sdf")) # doctest:+ELLIPSIS
  >>> len(dataset)
  2
class_docstr_tok: ["Creates","a","`","Dataset","`","object","from","SDF","input","files",".","This","class","provides","conveniences","to","load","and","featurize","data","from","Structure","Data","Files","(","SDFs",")",".","SDF","is","a","standard","format","for","structural","information","(","3D","coordinates","of","atoms","and","bonds",")","of","molecular","compounds",".","Examples","--","--","--","--",">",">",">","import","deepchem","as","dc",">",">",">","import","os",">",">",">","current_dir","=","os.path.dirname","(","os.path.realpath","(","__file__",")",")",">",">",">","featurizer","=","dc.feat.CircularFingerprint","(","size=16",")",">",">",">","loader","=","dc.data.SDFLoader","(","[","``","LogP","(","RRCK",")","''","]",",","featurizer=featurizer",",","sanitize=True",")",">",">",">","dataset","=","loader.create_dataset","(","os.path.join","(","current_dir",",","``","tests","''",",","``","membrane_permeability.sdf","''",")",")","#","doctest",":","+ELLIPSIS",">",">",">","len","(","dataset",")","2"]
docstr: Featurizes a shard of an input dataframe.
  
  Helper that computes features for the given shard of data.
  
  Parameters
  ----------
  shard: pd.DataFrame
      DataFrame that holds data to be featurized.
  
  Returns
  -------
  features: np.ndarray
      Array of feature vectors. Note that samples for which featurization has
      failed will be filtered out.
  valid_inds: np.ndarray
      Boolean values indicating successful featurization for corresponding
      sample in the source.
docstr_tok: ["Featurizes","a","shard","of","an","input","dataframe",".","Helper","that","computes","features","for","the","given","shard","of","data",".","Parameters","--","--","--","--","--","shard",":","pd.DataFrame","DataFrame","that","holds","data","to","be","featurized",".","Returns","--","--","--","-","features",":","np.ndarray","Array","of","feature","vectors",".","Note","that","samples","for","which","featurization","has","failed","will","be","filtered","out",".","valid_inds",":","np.ndarray","Boolean","values","indicating","successful","featurization","for","corresponding","sample","in","the","source","."]
code: def _featurize_shard(
      self, shard: pd.DataFrame
  ) -> Tuple[np.ndarray, np.ndarray]:
      """Featurizes a shard of an input dataframe.
  
      Helper that computes features for the given shard of data.
  
      Parameters
      ----------
      shard: pd.DataFrame
          DataFrame that holds data to be featurized.
  
      Returns
      -------
      features: np.ndarray
          Array of feature vectors. Note that samples for which featurization has
          failed will be filtered out.
      valid_inds: np.ndarray
          Boolean values indicating successful featurization for corresponding
          sample in the source.
      """
      pos_cols = ["pos_x", "pos_y", "pos_z"]
      if set(pos_cols).issubset(shard.columns):
          features = [
              elt
              for elt in self.featurizer(
                  shard[self.mol_field],
                  pos_x=shard["pos_x"],
                  pos_y=shard["pos_y"],
                  pos_z=shard["pos_z"],
              )
          ]
      else:
          features = [
              elt for elt in self.featurizer(shard[self.mol_field])
          ]
      valid_inds = np.array(
          [1 if np.array(elt).size > 0 else 0 for elt in features],
          dtype=bool,
      )
      features = [
          elt
          for (is_valid, elt) in zip(valid_inds, features)
          if is_valid
      ]
      try:
          return np.array(features), valid_inds
      except ValueError as e:
          logger.warning("Exception message: {}".format(e))
          return np.asarray(features, dtype=object), valid_inds
  
imports: import os
  import tempfile
  import zipfile
  import time
  import logging
  import warnings
  from typing import List, Optional, Tuple, Any, Sequence, Union, Iterator
  import pandas
  import numpy
  from deepchem.utils.typing import OneOrMany
  from deepchem.utils.data_utils import load_image_files, load_csv_files, load_json_files, load_sdf_files, unzip_file
  from deepchem.feat import UserDefinedFeaturizer, Featurizer
  from deepchem.data import Dataset, DiskDataset, NumpyDataset, ImageDataset
  from deepchem.feat.molecule_featurizers import OneHotFeaturizer
  from deepchem.utils.genomics_utils import encode_bio_sequence
label_desc: Use image node_id 4 for calling the SDFLoader obj's underlying member method code with example usage: obj._featurize_shard(shard) and returns: np,  valid_inds, np,  valid_inds