marrink-lab / vermouth-martinize

Describe and apply transformation on molecular structures and topologies
Apache License 2.0
97 stars 43 forks source link

`itp_read.py` doens't handle `#else` lines in `itp` #362

Closed ricalessandri closed 3 years ago

ricalessandri commented 3 years ago

One can define the following in an itp (used in some of the small molecule itps, for example):

#ifdef FLEXIBLE
[bonds]
#else
[constraints]
#endif
; i  j  funct length
  1  2   1     0.293 1000000 ; cog
....

and while the #ifdefand #endif are handled, the #else line throws the error:

...
...
  File "/Users/riccardo/ric.alessandri/Repos/polyply/vermouth-martinize/vermouth/gmx/itp_read.py", line 140, in parse_pragma
    raise IOError("Don't know how to parse pargma {} at"
OSError: Don't know how to parse pargma #else atline 11.