"...ssh:/git@developer.sourcefind.cn:2222/tsoc/openmm.git" did not exist on "6e29cb3ff86226d83700dccd09c2aedb770a2e5c"
Commit 0515bdf6 authored by tic20's avatar tic20
Browse files

Leave XML data structure unchanged during parsing.

parent 174b57e4
...@@ -266,13 +266,13 @@ class ForceField(object): ...@@ -266,13 +266,13 @@ class ForceField(object):
atomIndices = template.atomIndices atomIndices = template.atomIndices
for ia, atom in enumerate(residue.findall('Atom')): for ia, atom in enumerate(residue.findall('Atom')):
params = {} params = {}
a_attrib = atom.attrib for key in atom.attrib:
atomName = a_attrib.pop('name') if key not in ('name', 'type'):
params[key] = _convertParameterToNumber(atom.attrib[key])
atomName = atom.attrib['name']
if atomName in atomIndices: if atomName in atomIndices:
raise ValueError('Residue '+resName+' contains multiple atoms named '+atomName) raise ValueError('Residue '+resName+' contains multiple atoms named '+atomName)
typeName = a_attrib.pop('type') typeName = atom.attrib['type']
for key in atom.attrib:
params[key] = _convertParameterToNumber(atom.attrib[key])
atomIndices[atomName] = ia atomIndices[atomName] = ia
template.atoms.append(ForceField._TemplateAtomData(atomName, typeName, self._atomTypes[typeName].element, params)) template.atoms.append(ForceField._TemplateAtomData(atomName, typeName, self._atomTypes[typeName].element, params))
for site in residue.findall('VirtualSite'): for site in residue.findall('VirtualSite'):
......
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