Unverified Commit ea70f884 authored by Suzukazole's avatar Suzukazole
Browse files

add shape test

parent 1705fcb1
Loading
Loading
Loading
Loading
+22 −6
Original line number Diff line number Diff line
import os 
import unittest
import numpy as np

from deepchem.trans.transformers import RxnSplitTransformer


reactions: np.ndarray = np.array(["CC(C)C[Mg+].CON(C)C(=O)c1ccc(O)nc1>C1CCOC1.[Cl-]>CC(C)CC(=O)c1ccc(O)nc1",
"CN.O=C(O)c1ccc(Cl)c([N+](=O)[O-])c1>O>CNc1ccc(C(=O)O)cc1[N+](=O)[O-]",
"CCn1cc(C(=O)O)c(=O)c2cc(F)c(-c3ccc(N)cc3)cc21.O=CO>>CCn1cc(C(=O)O)c(=O)c2cc(F)c(-c3ccc(NC=O)cc3)cc21"], dtype=object)

sep_split = (np.array([['CC(C)C[Mg+].CON(C)C(=O)c1ccc(O)nc1>C1CCOC1.[Cl-]',
        'CC(C)CC(=O)c1ccc(O)nc1'],
       ['CN.O=C(O)c1ccc(Cl)c([N+](=O)[O-])c1>O',
        'CNc1ccc(C(=O)O)cc1[N+](=O)[O-]'],
       ['CCn1cc(C(=O)O)c(=O)c2cc(F)c(-c3ccc(N)cc3)cc21.O=CO>',
        'CCn1cc(C(=O)O)c(=O)c2cc(F)c(-c3ccc(NC=O)cc3)cc21']], dtype='<U51'), [], [], [])


class TestRxnSplitTransformer(unittest.TestCase):
    """Tests the Reaction split transformer for the source/target splitting and
    for the reagent mixing operation.
@@ -12,11 +26,13 @@ class TestRxnSplitTransformer(unittest.TestCase):
        """
        Tests the source/target split from an input reaction SMILES.
        """
        trans = RxnSplitTransformer(sep_reagent=True)
        split_reactions = trans.transform_array(X=reactions, y=[], w=[], ids=[])
        assert split_reactions[0].shape == (3, 2)



    def test_mixing(self):
        """
        Tests the reagent - reactant mixing option.
        """
        pass 
    #def test_mixing(self):
    #    """
    #    Tests the reagent - reactant mixing option.
    #    """
    #    pass