Becksteinlab / GromacsWrapper

GromacsWrapper wraps system calls to GROMACS tools into thin Python classes (GROMACS 4.6.5 - 2024 supported).
https://gromacswrapper.readthedocs.org
GNU General Public License v3.0
169 stars 53 forks source link

Invalid conversion specification when doing itp.write #98

Closed mohebifar closed 7 years ago

mohebifar commented 8 years ago

I have this piece of code for reading an ITP file, modifying it and writing a new one. I have taken out the modification part because it doesn't work anyway:

itp = gromacs.fileformats.ITP('isobutane.itp')
itp.write('isobutane-modified.itp')

But I get this error:

ValueError: Invalid conversion specification

And the error comes from itp.py#518. However, version 0.6.0 works. So I think the commit 7e8fe136 and changing the string formatting is causing this issue.

orbeckst commented 8 years ago

Thanks for reporting.

If you already have an idea for how to fix it, submit a pull request, please!

orbeckst commented 7 years ago

@mohebifar we very much appreciate your fixes! But I do need to tell you that the ITP parser has various issues #5, #6, #8, #9 (with #6 being particularly problematic), and over the years there has been not very much drive to fix them. Of course, you'd be most welcome to work on any of them or to come with your own solution.

But there might also be other projects that can help you do thing that the GromacsWrapper implementation might not be able to do. In particular, ParmEd is a very interesting and well maintained project, that specializes in working with parameter files.