Commit 071e12da authored by nd-02110114's avatar nd-02110114
Browse files

Merge branch 'master' into fix-docs-build-0

parents ed6d4140 53c3b550
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -520,7 +520,7 @@ class Dataset(object):
    try:
      import tensorflow as tf
    except:
      raise ValueError("This method requires TensorFlow to be installed.")
      raise ImportError("This method requires TensorFlow to be installed.")

    # Retrieve the first sample so we can determine the dtypes.
    X, y, w, ids = next(self.itersamples())
@@ -943,7 +943,7 @@ class NumpyDataset(Dataset):
    try:
      from deepchem.data.pytorch_datasets import _TorchNumpyDataset
    except:
      raise ValueError("This method requires PyTorch to be installed.")
      raise ImportError("This method requires PyTorch to be installed.")

    pytorch_ds = _TorchNumpyDataset(
        numpy_dataset=self,
@@ -1829,7 +1829,7 @@ class DiskDataset(Dataset):
    try:
      from deepchem.data.pytorch_datasets import _TorchDiskDataset
    except:
      raise ValueError("This method requires PyTorch to be installed.")
      raise ImportError("This method requires PyTorch to be installed.")

    pytorch_ds = _TorchDiskDataset(
        disk_dataset=self,
+3 −3
Original line number Diff line number Diff line
@@ -255,7 +255,7 @@ class MolecularFeaturizer(Featurizer):
      from rdkit.Chem import rdmolops
      from rdkit.Chem.rdchem import Mol
    except ModuleNotFoundError:
      raise ValueError("This class requires RDKit to be installed.")
      raise ImportError("This class requires RDKit to be installed.")

    # Special case handling of single molecule
    if isinstance(molecules, str) or isinstance(molecules, Mol):
@@ -337,7 +337,7 @@ class MaterialStructureFeaturizer(Featurizer):
    try:
      from pymatgen import Structure
    except ModuleNotFoundError:
      raise ValueError("This class requires pymatgen to be installed.")
      raise ImportError("This class requires pymatgen to be installed.")

    structures = list(structures)
    features = []
@@ -400,7 +400,7 @@ class MaterialCompositionFeaturizer(Featurizer):
    try:
      from pymatgen import Composition
    except ModuleNotFoundError:
      raise ValueError("This class requires pymatgen to be installed.")
      raise ImportError("This class requires pymatgen to be installed.")

    compositions = list(compositions)
    features = []
+1 −1
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ class BindingPocketFeaturizer(Featurizer):
    try:
      import mdtraj
    except ModuleNotFoundError:
      raise ValueError("This class requires RDKit to be installed.")
      raise ImportError("This class requires mdtraj to be installed.")

    protein_coords = load_molecule(
        protein_file, add_hydrogens=False, calc_charges=False)[0]
+2 −2
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ class GraphData:
      import torch
      from torch_geometric.data import Data
    except ModuleNotFoundError:
      raise ValueError(
      raise ImportError(
          "This function requires PyTorch Geometric to be installed.")

    edge_features = self.edge_features
@@ -139,7 +139,7 @@ class GraphData:
      import torch
      from dgl import DGLGraph
    except ModuleNotFoundError:
      raise ValueError("This function requires DGL to be installed.")
      raise ImportError("This function requires DGL to be installed.")

    g = DGLGraph()
    g.add_nodes(self.num_nodes)
+1 −1
Original line number Diff line number Diff line
@@ -392,7 +392,7 @@ def bond_features(bond, use_chirality=False):
  try:
    from rdkit import Chem
  except ModuleNotFoundError:
    raise ValueError("This method requires RDKit to be installed.")
    raise ImportError("This method requires RDKit to be installed.")
  bt = bond.GetBondType()
  bond_feats = [
      bt == Chem.rdchem.BondType.SINGLE, bt == Chem.rdchem.BondType.DOUBLE,
Loading