Commit c68ab3c9 authored by nd-02110114's avatar nd-02110114
Browse files

✅ add pyg tests and update dependecies

parent fd09f50b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ conda install -y -c conda-forge rdkit deepchem==2.3.0
You install the nightly build version via pip. The nightly version is built by the HEAD of DeepChem.

```bash
pip install tensorflow==2.2
pip install tensorflow==2.2.0
pip install --pre deepchem
```

+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ class CircularFingerprint(MolecularFeaturizer):
      from rdkit.Chem import rdMolDescriptors
    except ModuleNotFoundError:
      raise ValueError("This class requires RDKit to be installed.")

    self.radius = radius
    self.size = size
    self.chiral = chiral
+12 −0
Original line number Diff line number Diff line
@@ -28,6 +28,12 @@ class TestGraph(unittest.TestCase):
    assert graph.num_edges == num_edges
    assert graph.num_edge_features == num_edge_features

    # check to_pyg_data function
    target = np.array([1], dtype=np.float)
    pyg_graph = graph.to_pyg_data(target)
    from torch_geometric.data import Data
    assert isinstance(pyg_graph, Data)

  def test_invalid_graph_data(self):
    with pytest.raises(ValueError):
      invalid_node_features_type = list(np.random.random_sample((5, 5)))
@@ -81,3 +87,9 @@ class TestGraph(unittest.TestCase):
    assert batch.num_edges == sum(num_edge_list)
    assert batch.num_edge_features == num_edge_features
    assert batch.graph_index.shape == (sum(num_nodes_list),)

    # check to_pyg_data function
    targets = np.array([1, 2, 3], dtype=np.float)
    batch = BatchGraphData.to_pyg_data(graph_list=graphs, targets=targets)
    from torch_geometric.data import Batch
    assert isinstance(pyg_graph, Batch)
+2 −3
Original line number Diff line number Diff line
"""
Test featurizers for inorganic crystals.
"""
import numpy as np
import unittest
import numpy as np

from deepchem.feat.material_featurizers \
  import ElementPropertyFingerprint, SineCoulombMatrix, CGCNNFeaturizer
from deepchem.feat import ElementPropertyFingerprint, SineCoulombMatrix, CGCNNFeaturizer


class TestMaterialFeaturizers(unittest.TestCase):
+2 −2
Original line number Diff line number Diff line
@@ -94,8 +94,8 @@ class GaussianProcessHyperparamOpt(HyperparamOpt):
  `GridHyperparamOpt`. `param_dict[hp]` must be an int/float and is
  used as the center of a search range.

  Example
  -------
  Examples
  --------
  This example shows the type of constructor function expected.

  >>> import sklearn
Loading