Ejemplo n.º 1
0
    def test_read_gro(self):
        top = read_gro(get_fn('acn.gro'))

        assert top.name == 'ACN'
        assert top.n_sites == 6
        assert_allclose_units(top.box.lengths, 4*np.ones(3)*u.nm, rtol=1e-5, atol=1e-8)

        top = read_gro(get_fn('350-waters.gro'))

        assert top.name == 'Generic title'
        assert top.n_sites == 1050
        assert_allclose_units(top.box.lengths, 2.20866*np.ones(3)*u.nm, rtol=1e-5, atol=1e-8)
Ejemplo n.º 2
0
 def test_wrong_n_atoms(self):
     with pytest.raises(ValueError):
         read_gro(get_fn('too_few_atoms.gro'))
     with pytest.raises(ValueError):
         read_gro(get_fn('too_many_atoms.gro'))