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

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

src/m/d/MDAnalysisTests-0.8.1/MDAnalysisTests/test_distances.py   MDAnalysisTests(Download)
    def test_ortho_PBC(self):
        from MDAnalysis.core.distances import applyPBC
        U = MDAnalysis.Universe(PSF, DCD)
        atoms = U.atoms.coordinates()
        box1 = np.array([2.5, 2.5, 3.5], dtype=np.float32)
    def test_tric_PBC(self):
        from MDAnalysis.core.distances import applyPBC
        U = MDAnalysis.Universe(TRIC)
        atoms = U.atoms.coordinates()
        box1 = U.dimensions

src/m/d/MDAnalysisTests-0.8.1/MDAnalysisTests/test_coordinates.py   MDAnalysisTests(Download)
    def test_writer(self):
        "Test writing from a single frame PDB file to a PDB file."""
        self.universe.atoms.write(self.outfile)
        u = mda.Universe(PSF, self.outfile, permissive=True)
        assert_almost_equal(u.atoms.coordinates(), self.universe.atoms.coordinates(), self.prec,
        u2 = MDAnalysis.Universe(PSF, self.outfile)
        assert_equal(u2.trajectory.numframes, 1, err_msg="Output PDB should only contain a single frame")
        assert_almost_equal(u2.atoms.coordinates(), u.atoms.coordinates(), self.prec,
                            err_msg="Written coordinates do not agree with original coordinates from frame %d" % u.trajectory.frame)
 
    def test_writer(self):
        self.universe.atoms.write(self.outfile)
        u = mda.Universe(self.outfile)
        assert_almost_equal(u.atoms.coordinates(), self.universe.atoms.coordinates(), self.prec,
                            err_msg="Writing GRO file with GROWriter does not reproduce original coordinates")
        w = MDAnalysis.Universe(PSF, self.outfile)
        assert_equal(w.trajectory.numframes, 1, "single frame trajectory has wrong number of frames")
        assert_almost_equal(w.atoms.coordinates(), u.atoms.coordinates(), 3,
                            err_msg="coordinates do not match")