def test_cnv_nc(): os.remove("processed/p9761/24/7/cnv.nc") with open("processed/p9761/24/7/info_precnv.json") as f: info = json.load(f) process._cnv2(info, has_overlapping_frames=True) top = 'tops-p9712/{top[struct]}.prmtop'.format(**info) trj1 = mdtraj.load(info['cnv1']['gens'][0], top=top) trj2 = mdtraj.load(info['cnv2']['gens'][0], top=top) np.testing.assert_array_almost_equal(trj1.xyz[:-1], trj2.xyz) np.testing.assert_array_almost_equal(trj1.unitcell_vectors[:-1], trj2.unitcell_vectors) np.testing.assert_array_almost_equal(trj1.time[:-1], trj2.time)
def test_nc_cpptraj(): os.remove("processed/p9761/24/7/cnv.nc") with open("processed/p9761/24/7/info_precnv.json") as f: info = json.load(f) process._cnv2(info, has_overlapping_frames=True) top = 'tops-p9712/{top[struct]}.prmtop'.format(**info) out = "{workdir}/test.nc".format(**info['path']) subprocess.check_call( ['cpptraj', '-p', top, '-y', info['cnv2']['gens'][0], '-x', out], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) trj1 = mdtraj.load(out, top=top) trj2 = mdtraj.load(info['cnv2']['gens'][0], top=top) np.testing.assert_array_almost_equal(trj1.xyz, trj2.xyz) np.testing.assert_array_almost_equal(trj1.unitcell_vectors, trj2.unitcell_vectors)
def test_nc_cpptraj(): os.remove("processed/p9761/24/7/cnv.nc") with open("processed/p9761/24/7/info_precnv.json") as f: info = json.load(f) process._cnv2(info, has_overlapping_frames=True) top = 'tops-p9712/{top[struct]}.prmtop'.format(**info) out = "{workdir}/test.nc".format(**info['path']) subprocess.check_call([ 'cpptraj', '-p', top, '-y', info['cnv2']['gens'][0], '-x', out ], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) trj1 = mdtraj.load(out, top=top) trj2 = mdtraj.load(info['cnv2']['gens'][0], top=top) np.testing.assert_array_almost_equal(trj1.xyz, trj2.xyz) np.testing.assert_array_almost_equal(trj1.unitcell_vectors, trj2.unitcell_vectors)