"vscode:/vscode.git/clone" did not exist on "63f79469b2a2f25dacccafaa085ec2fb47729eb0"
Commit bc90b216 authored by Peter Eastman's avatar Peter Eastman
Browse files

Throw exception if an atom type is defined twice

parent 248e8883
...@@ -88,7 +88,10 @@ class ForceField(object): ...@@ -88,7 +88,10 @@ class ForceField(object):
element = None element = None
if 'element' in type.attrib: if 'element' in type.attrib:
element = elem.get_by_symbol(type.attrib['element']) element = elem.get_by_symbol(type.attrib['element'])
self._atomTypes[type.attrib['name']] = (type.attrib['class'], float(type.attrib['mass']), element) name = type.attrib['name']
if name in self._atomTypes:
raise ValueError('Found multiple definitions for atom type: '+name)
self._atomTypes[name] = (type.attrib['class'], float(type.attrib['mass']), element)
# Load the residue templates. # Load the residue templates.
......
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