Ejemplo n.º 1
0
 def test_select_with_no_criteria(self):
     """
      test select with no screening criteria
     """
     bndSel = BondSelector()
     ats = self.mol.allAtoms[:10]
     bnds = ats.bonds[0]
     bndSel.select(bnds)
Ejemplo n.º 2
0
 def test_select_with_no_criteria(self):
     """
      test select with no screening criteria
     """
     bndSel = BondSelector()
     ats = self.mol.allAtoms[:10]
     bnds = ats.bonds[0]
     bndSel.select(bnds)
Ejemplo n.º 3
0
 def test_select_no_bonds(self):
     """
      test select with criteria which selects no bonds
     """
     bndSel = BondSelector([lambda x: x.atom1.number == 2000])
     ats = self.mol.allAtoms[:10]
     bnds = ats.bonds[0]
     resultBnds = bndSel.select(bnds)
     self.assertEqual(len(resultBnds), 0)
Ejemplo n.º 4
0
 def test_select_all_bonds(self):
     """
      test select with criteria which selects all bonds
     """
     bndSel = BondSelector([lambda x: x])
     ats = self.mol.allAtoms[:10]
     bnds = ats.bonds[0]
     resultBnds = bndSel.select(bnds)
     self.assertEqual(len(resultBnds), len(bnds))
Ejemplo n.º 5
0
 def test_select_all_bonds(self):
     """
      test select with criteria which selects all bonds
     """
     bndSel = BondSelector([lambda x:x])
     ats = self.mol.allAtoms[:10]
     bnds = ats.bonds[0]
     resultBnds = bndSel.select(bnds)
     self.assertEqual(len(resultBnds) , len(bnds))
Ejemplo n.º 6
0
 def test_select_no_bonds(self):
     """
      test select with criteria which selects no bonds
     """
     bndSel = BondSelector([lambda x:x.atom1.number==2000])
     ats = self.mol.allAtoms[:10]
     bnds = ats.bonds[0]
     resultBnds = bndSel.select(bnds)
     self.assertEqual(len(resultBnds) , 0)
Ejemplo n.º 7
0
 def test_select_one_bond(self):
     """
      test select with criteria which selects one bond
     """
     bndSel = BondSelector([lambda x: x.atom1.number == 1])
     ats = self.mol.allAtoms[:10]
     bnds = ats.bonds[0]
     resultBnds = bndSel.select(bnds)
     #self.assertEqual(len(resultBnds) , 1)
     self.assertEqual(len(resultBnds), 3)
Ejemplo n.º 8
0
 def test_select_one_bond(self):
     """
      test select with criteria which selects one bond
     """
     bndSel = BondSelector([lambda x:x.atom1.number==1])
     ats = self.mol.allAtoms[:10]
     bnds = ats.bonds[0]
     resultBnds = bndSel.select(bnds)
     #self.assertEqual(len(resultBnds) , 1)
     self.assertEqual(len(resultBnds) , 3)
 def test_select_two_criteria(self):
     """
      test select with two criteria, result is sum 
     """
     bndSel = BondSelector([lambda x: x.atom1.number == 1, lambda x: x.atom1.number == 2])
     ats = self.mol.allAtoms[:10]
     bnds = ats.bonds[0]
     resultBnds = bndSel.select(bnds)
     # self.assertEqual(len(resultBnds) , 3)
     self.assertEqual(len(resultBnds), 5)
Ejemplo n.º 10
0
 def test_select_three_bonds(self):
     """
      test select with criteria which selects some bonds
     """
     bndSel = BondSelector([lambda x:x.atom1.number==1 or x.atom1.number==2])
     ats = self.mol.allAtoms[:10]
     bnds = ats.bonds[0]
     resultBnds = bndSel.select(bnds)
     #print "len(resultBnds)=", len(resultBnds)
     #self.assertEqual(len(resultBnds) , 3)
     self.assertEqual(len(resultBnds) , 5)
Ejemplo n.º 11
0
 def test_select_two_criteria(self):
     """
      test select with two criteria, result is sum 
     """
     bndSel = BondSelector([lambda x:x.atom1.number==1, lambda x:\
                 x.atom1.number==2])
     ats = self.mol.allAtoms[:10]
     bnds = ats.bonds[0]
     resultBnds = bndSel.select(bnds)
     #self.assertEqual(len(resultBnds) , 3)
     self.assertEqual(len(resultBnds), 5)
Ejemplo n.º 12
0
 def test_select_three_criteria(self):
     """
      test select with three criteria, result is sum 
     """
     bndSel = BondSelector([lambda x:x.atom1.number==1, lambda x:\
                 x.atom1.number==2,lambda x:x.atom1.name=='CA'])
     ats = self.mol.allAtoms[:10]
     bnds = ats.bonds[0]
     resultBnds = bndSel.select(bnds)
     #print 'len(resultBnds)==', len(resultBnds)
     #self.assertEqual(len(resultBnds) , 4)
     self.assertEqual(len(resultBnds), 5)
Ejemplo n.º 13
0
 def test_select_three_criteria(self):
     """
      test select with three criteria, result is sum 
     """
     bndSel = BondSelector([lambda x:x.atom1.number==1, lambda x:\
                 x.atom1.number==2,lambda x:x.atom1.name=='CA'])
     ats = self.mol.allAtoms[:10]
     bnds = ats.bonds[0]
     resultBnds = bndSel.select(bnds)
     #print 'len(resultBnds)==', len(resultBnds)
     #self.assertEqual(len(resultBnds) , 4)
     self.assertEqual(len(resultBnds) , 5)
Ejemplo n.º 14
0
 def test_select_three_bonds(self):
     """
      test select with criteria which selects some bonds
     """
     bndSel = BondSelector(
         [lambda x: x.atom1.number == 1 or x.atom1.number == 2])
     ats = self.mol.allAtoms[:10]
     bnds = ats.bonds[0]
     resultBnds = bndSel.select(bnds)
     #print "len(resultBnds)=", len(resultBnds)
     #self.assertEqual(len(resultBnds) , 3)
     self.assertEqual(len(resultBnds), 5)
Ejemplo n.º 15
0
    def test_constructorOptions(self):
        """
         test possible constructor options
            options = [lambda x: cond1, lambda x: cond2...]
        """

        bndSel = BondSelector([lambda x: x])
        self.assertEquals(bndSel.__class__, BondSelector)
Ejemplo n.º 16
0
 def test_select_with_no_bonds(self):
     """
      test select with no input bonds
     """
     bndSel = BondSelector([lambda x:x])
     bndSel.select()
Ejemplo n.º 17
0
 def test_constructor(self):
     """
     instantiate an BondSelector
     """
     bndSel = BondSelector()
     self.assertEquals(bndSel.__class__, BondSelector)
Ejemplo n.º 18
0
 def test_select_with_no_bonds(self):
     """
      test select with no input bonds
     """
     bndSel = BondSelector([lambda x: x])
     bndSel.select()