Пример #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)
 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)
Пример #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)
Пример #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))
 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)
 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))
Пример #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)
 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)
Пример #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)
Пример #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)
Пример #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)
Пример #13
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)
Пример #14
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)
Пример #15
0
 def test_select_with_no_bonds(self):
     """
      test select with no input bonds
     """
     bndSel = BondSelector([lambda x:x])
     bndSel.select()
Пример #16
0
 def test_select_with_no_bonds(self):
     """
      test select with no input bonds
     """
     bndSel = BondSelector([lambda x: x])
     bndSel.select()