Skip to content

Repository files navigation

groIO

https://travis-ci.org/HubLot/groio.svg?branch=masterhttps://coveralls.io/repos/HubLot/groio/badge.svg?branch=master&service=github

A library to handle the reading and writing of a gro file.

Installation

pip install groio

Usage

importgroio#Read a gro filetitle, atoms, box=groio.parse_file("filin.gro")
#Write a gro filewithopen("filout.gro", "w") asf:
forlineingroio.write_gro(title, output_atoms, box):
print(line, end='', file=f)
#Renumber the atoms to avoid number above 100 000atoms=groio.renumber(atoms)

The function parse_file returns :

  • title: the title of the system as written on line 1 of the file as a string
  • atoms: a list of atom, each atom is stored as a dictionary
  • box: the box description as written on the last line as a string

Run tests

Unit tests are available through nosetests python module.
nosetests tests/test_groio.py

About

A really simple library for gro files

Resources

Stars

3 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages