Unverified Commit 1705fcb1 authored by Suzukazole's avatar Suzukazole
Browse files

init tests

parent 971eee59
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
import os 
import unittest

from deepchem.trans.transformers import RxnSplitTransformer

class TestRxnSplitTransformer(unittest.TestCase):
    """Tests the Reaction split transformer for the source/target splitting and
    for the reagent mixing operation.
    """

    def test_split(self):
        """
        Tests the source/target split from an input reaction SMILES.
        """
        


    def test_mixing(self):
        """
        Tests the reagent - reactant mixing option.
        """
        pass 
+6 −4
Original line number Diff line number Diff line
@@ -2485,10 +2485,9 @@ class RxnSplitTransformer(Transformer):
  -----
  This class only transforms the feature field of a reaction dataset like USPTO.

  
  """

  def __init__(self, sep_reagent: bool):
  def __init__(self, sep_reagent: bool, dataset: Optional[Dataset] = None):
    # the transformer would have to split the source and target sequences
    # would also consider adding the option of separating the reagent here.

@@ -2530,7 +2529,10 @@ class RxnSplitTransformer(Transformer):
    if self.sep_reagent:
      source = [x + '>' + y for x, y in zip(reactant, reagent)]
    else:
      source = [x + '.' + y + '>' if y else x + '>' + y for x,y in zip(reactant, reagent)]
      source = [
          x + '.' + y + '>' if y else x + '>' + y
          for x, y in zip(reactant, reagent)
      ]

    target = product