def test_gro_velocities(self):
     """ Test parsing and writing GROMACS GRO files with velocities """
     gro = load_file(get_fn('1aki.ff99sbildn.gro'))
     self.assertIsInstance(gro, Structure)
     vel = np.random.rand(len(gro.atoms), 3)
     gro.velocities = vel
     fn = get_fn('test.gro', written=True)
     gro.save(fn)
     self.assertTrue(GromacsGroFile.id_format(fn))
     gro.save(fn, overwrite=True, precision=8)
     self.assertTrue(GromacsGroFile.id_format(fn))
     with open(fn) as f:
         tmp = GromacsGroFile.parse(f)
     np.testing.assert_allclose(vel, tmp.velocities, atol=1e-8)
 def test_gro_detection(self):
     """ Tests automatic detection of GROMACS GRO files """
     fn = get_fn('candidate.gro', written=True)
     with open(fn, 'w') as f:
         f.write('Some title\n 1000\n    aISNot a valid format\n')
     self.assertFalse(GromacsGroFile.id_format(fn))