Commit a29ebb6f authored by Peter Eastman's avatar Peter Eastman
Browse files

Improved "no template found" error message to suggest possible causes.

parent 886533b9
...@@ -311,7 +311,7 @@ class ForceField(object): ...@@ -311,7 +311,7 @@ class ForceField(object):
template = t template = t
break break
if matches is None: if matches is None:
raise ValueError('No template found for residue %d (%s)' % (res.index+1, res.name)) raise ValueError('No template found for residue %d (%s). This might mean your input topology is missing some atoms or bonds, or possibly that you are using the wrong force field.' % (res.index+1, res.name))
for atom, match in zip(res.atoms(), matches): for atom, match in zip(res.atoms(), matches):
data.atomType[atom] = template.atoms[match].type data.atomType[atom] = template.atoms[match].type
for site in template.virtualSites: for site in template.virtualSites:
......
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