コード例 #1
0
ファイル: UnitTestcBitVect.py プロジェクト: yinxx/rdkit
    def testFold(self):
        """ test folding fingerprints
    """
        v1 = self.klass(16)
        v1[1] = 1
        v1[12] = 1
        v1[9] = 1
        v2 = cDataStructs.FoldFingerprint(v1)  # check fold with no args
        assert v1.GetNumBits() / 2 == v2.GetNumBits(
        ), 'bad num bits post folding'
        v2 = cDataStructs.FoldFingerprint(v1, 2)  # check fold with arg

        assert v1.GetNumBits() / 2 == v2.GetNumBits(
        ), 'bad num bits post folding'

        v2 = cDataStructs.FoldFingerprint(v1, 4)
        assert v1.GetNumBits() / 4 == v2.GetNumBits(
        ), 'bad num bits post folding'
コード例 #2
0
ファイル: UnitTestcBitVect.py プロジェクト: dahuilangda/rdkit
  def testFold(self):
    """ test folding fingerprints
    """
    v1 = klass(16)
    v1[1] = 1
    v1[12] = 1
    v1[9] = 1
    try:
      v2 = cDataStructs.FoldFingerprint(v1)
    except:
      assert 0,'Fold with no args failed'
    assert v1.GetNumBits()/2==v2.GetNumBits(),'bad num bits post folding'
    try:
      v2 = cDataStructs.FoldFingerprint(v1,2)
    except:
      assert 0,'Fold with arg failed'
      
    assert v1.GetNumBits()/2==v2.GetNumBits(),'bad num bits post folding'


    v2 = cDataStructs.FoldFingerprint(v1,4)
    assert v1.GetNumBits()/4==v2.GetNumBits(),'bad num bits post folding'