Tsjerk / Insane

INSert membrANE - A simple, versatile tool for building coarse-grained simulation systems
GNU General Public License v2.0
47 stars 26 forks source link

cannot convert string to float #77

Closed BartBruininks closed 2 years ago

BartBruininks commented 2 years ago

This is caused when there is no box description in the GRO as the last line. Not sure if this is a bug...

insane -o system.gro -p topol.top -f ../em_dry.gro -d 7 -sol W -salt 0.157

Traceback (most recent call last): File "/home/bart/.virtualenvs/md/bin/insane", line 8, in sys.exit(cli()) File "/home/bart/.virtualenvs/md/lib/python3.8/site-packages/insane/cli.py", line 164, in cli sys.exit(main(sys.argv)) File "/home/bart/.virtualenvs/md/lib/python3.8/site-packages/insane/cli.py", line 145, in main box) = core.old_main(argv, options) File "/home/bart/.virtualenvs/md/lib/python3.8/site-packages/insane/core.py", line 1051, in old_main tm = [ Structure(i) for i in options["solute"] ] File "/home/bart/.virtualenvs/md/lib/python3.8/site-packages/insane/core.py", line 1051, in tm = [ Structure(i) for i in options["solute"] ] File "/home/bart/.virtualenvs/md/lib/python3.8/site-packages/insane/core.py", line 291, in init self.box = groBoxRead(lines[-1]) File "/home/bart/.virtualenvs/md/lib/python3.8/site-packages/insane/core.py", line 98, in groBoxRead b = [float(i) for i in a.split()] + 6[0] # Padding for rectangular boxes File "/home/bart/.virtualenvs/md/lib/python3.8/site-packages/insane/core.py", line 98, in b = [float(i) for i in a.split()] + 6[0] # Padding for rectangular boxes ValueError: could not convert string to float: '23481POPC'

Tsjerk commented 2 years ago

No, not a bug. The GRO file format dictates a title, a number, so many lines of atom definitions as indicated by the number and then the box. (A more proper handling would have this raise an InvalidGroFormatError or so.)