What steps will reproduce the problem?
****************
import MDAnalysis.topology.TOPParser as top
top.parse("protCryst.prmtop")
What is the expected output? What do you see instead?
*****************
parse prmtop files, but got
+++++++
File "/Library/Python/2.6/site-packages/MDAnalysis-0.7.3-py2.6-macosx-10.6-universal.egg/MDAnalysis/topology/TOPParser.py", line 118, in parse
parse_sec(info)
File "/Library/Python/2.6/site-packages/MDAnalysis-0.7.3-py2.6-macosx-10.6-universal.egg/MDAnalysis/topology/TOPParser.py", line 89, in parse_sec
parsefunc(next_line, atoms_per, data_struc, structure, numlines)
File "/Library/Python/2.6/site-packages/MDAnalysis-0.7.3-py2.6-macosx-10.6-universal.egg/MDAnalysis/topology/TOPParser.py", line 195, in __parsesection_
x = util.FORTRANReader(y)
File "/Library/Python/2.6/site-packages/MDAnalysis-0.7.3-py2.6-macosx-10.6-universal.egg/MDAnalysis/core/util.py", line 268, in __init__
descriptors = [self.parse_FORTRAN_format(descriptor) for descriptor in self.fmt]
File "/Library/Python/2.6/site-packages/MDAnalysis-0.7.3-py2.6-macosx-10.6-universal.egg/MDAnalysis/core/util.py", line 324, in parse_FORTRAN_format
d = m.groupdict()
AttributeError: 'NoneType' object has no attribute 'groupdict'
++++++++++++++++
What version of the product are you using? On what operating system?
MDAnalysis0.7.3, Mac Os X 10.6
Please provide any additional information below.
in file TOPParser.py line 83
numlines = int((float(num)/per_line))
if “num" is divisible by "per_line", the parse will read one more line and
thus skip the FORMAT line
simply add
if(num % per_line == 0): numlines -= 1
fix the problem
Original issue reported on code.google.com by htao...@gmail.com on 2 Jun 2011 at 6:24
Original issue reported on code.google.com by
htao...@gmail.com
on 2 Jun 2011 at 6:24