def test_guess_improper_dihedrals(self): ag = self.u.atoms[:5] ag.bonds ag.angles # Group of angles to work off angs = self.u.angles.atomgroup_intersection(ag, strict=True) # Pre calculated reference result result = ((0, 4, 3, 2), (0, 3, 1, 4), (0, 4, 1, 3), (0, 2, 1, 4), (0, 4, 2, 1), (0, 4, 1, 2), (0, 3, 2, 4), (0, 3, 2, 1), (0, 4, 3, 1), (0, 3, 1, 2), (0, 4, 2, 3), (0, 2, 1, 3)) imps = guess_improper_dihedrals(angs) assert_equal(set(result), set(imps))
def test_guess_improper_dihedrals(self): ag = self.u.atoms[:5] ag.bonds ag.angles # Group of angles to work off angs = self.u.angles.atomgroup_intersection(ag, strict=True) # Pre calculated reference result result = ( (0, 4, 3, 2), (0, 3, 1, 4), (0, 4, 1, 3), (0, 2, 1, 4), (0, 4, 2, 1), (0, 4, 1, 2), (0, 3, 2, 4), (0, 3, 2, 1), (0, 4, 3, 1), (0, 3, 1, 2), (0, 4, 2, 3), (0, 2, 1, 3)) imps = guess_improper_dihedrals(angs) assert_equal(set(result), set(imps))
def test_guess_impropers_set(self): self.u.impropers = guess_improper_dihedrals(self.u.angles) assert_equal(len(self.u.impropers), 10314)