Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)

src/m/d/MDAnalysisTests-0.8.1/MDAnalysisTests/test_distances.py   MDAnalysisTests(Download)
    def test_bonds(self):
        dists = MDAnalysis.core.distances.calc_bonds(self.a, self.b)
        assert_equal(len(dists), 4, err_msg="calc_bonds results have wrong length")
        dists_pbc = MDAnalysis.core.distances.calc_bonds(self.a, self.b, box=self.box)
        #tests 0 length
    def test_bonds_triclinic(self):
        dists = MDAnalysis.core.distances.calc_bonds(self.a, self.b, box=self.box2)
        reference = np.array([0.0, 1.7320508, 1.4142136, 2.82842712])
        assert_almost_equal(dists, reference, self.prec, err_msg="calc_bonds with triclinic box failed")
    def test_numpy_compliance(self):
        # Checks that the cython functions give identical results to the numpy versions
        bonds = MDAnalysis.core.distances.calc_bonds(self.a, self.b)
        angles = MDAnalysis.core.distances.calc_angles(self.a, self.b, self.c)
        torsions = MDAnalysis.core.distances.calc_torsions(self.a, self.b, self.c, self.d)