Skip to main content

A simple library for gro files

Project description

https://travis-ci.org/HubLot/groio.svg?branch=master https://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

import groio

#Read a gro file
title, atoms, box = groio.parse_file("filin.gro")

#Write a gro file
with open("filout.gro", "w") as f:
    for line in groio.write_gro(title, output_atoms, box):
        print(line, end='', file=f)

#Renumber the atoms to avoid number above 100 000
atoms = 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

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

groio-1.0.tar.gz (207.7 kB view hashes)

Uploaded Source

Built Distribution

groio-1.0-py2.7.egg (6.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page