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

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

src/m/d/MDAnalysisTests-0.8.1/MDAnalysisTests/test_parallel.py   MDAnalysisTests(Download)
#     doi:10.1002/jcc.21787
#
from MDAnalysis.core.parallel.distances import distance_array, distance_array_serial
from MDAnalysis.core.distances import distance_array as distance_array_reference
 
            return np.linalg.norm(x - np.rint(x/box) * box)
        ref = mindist(a, b, box)
        val = distance_array(np.array([a]), np.array([b]), box)[0,0]
        assert_allclose(val, ref, rtol=1e-6, atol=1e-6,
                        err_msg="Issue 151 not correct (PBC in distance array)")
 
    def test_distance_array_parallel(self):
        cython_parallel = distance_array(self.coord[0], self.coord[1])
    def test_distance_array_parallel_results(self):
        result = np.empty((self.coord[0].shape[0], self.coord[0].shape[0])).astype(np.float32)
        cython_parallel = distance_array(self.coord[0], self.coord[1], result=result)
        assert_allclose(cython_parallel, self.ref, rtol=1e-6, atol=1e-6,
                        err_msg="Cython parallel distance matrix does not match C")
 
    def test_distance_array_parallel_pbc(self):
        cython_parallel = distance_array(self.coord[0], self.coord[1], box=self.box)