def test_read_write_trajectory():
    structures = md_trajectory_from_vasprun('test_files/test_vasprun.xml')
    fname = 'tst_traj.json'
    md_trajectory_to_file(fname, structures)
    fstructures = md_trajectory_from_file(fname)
    for (s, f) in zip(structures, fstructures):
        assert np.isclose(s.forces, f.forces).all()
        assert np.isclose(s.positions, f.positions).all()
    os.system('rm tst_traj.json')
def test_read_write_trajectory():
    structures = md_trajectory_from_vasprun('test_files/test_vasprun.xml')
    fname = 'tst_traj.json'
    md_trajectory_to_file(fname, structures)
    fstructures = md_trajectory_from_file(fname)
    for (s, f) in zip(structures, fstructures):
        assert np.isclose(s.forces, f.forces).all()
        assert np.isclose(s.positions, f.positions).all()
    os.system('rm tst_traj.json')