"platforms/hip/vscode:/vscode.git/clone" did not exist on "d2a5d7e40990be7c8b9764aa0366da05443badc9"
Commit 64b4ccc3 authored by Jason Swails's avatar Jason Swails
Browse files

Better error catch for using chamber prmtops

Prints out a more helpful error message than a weird regex-based missing
"groups" attribute on NoneType.
parent 7b67c27b
...@@ -127,6 +127,10 @@ class PrmtopLoader(object): ...@@ -127,6 +127,10 @@ class PrmtopLoader(object):
tag, self._prmtopVersion = line.rstrip().split(None, 1) tag, self._prmtopVersion = line.rstrip().split(None, 1)
elif line.startswith('%FLAG'): elif line.startswith('%FLAG'):
tag, flag = line.rstrip().split(None, 1) tag, flag = line.rstrip().split(None, 1)
if flag == 'CTITLE':
raise TypeError('CHAMBER-style topology files are not supported here. '
'Consider using the CHARMM files directly with CharmmPsfFile '
'or ParmEd (where CHAMBER topologies are supported)')
self._flags.append(flag) self._flags.append(flag)
self._raw_data[flag] = [] self._raw_data[flag] = []
elif line.startswith('%FORMAT'): elif line.startswith('%FORMAT'):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment