Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
895f8dac
Commit
895f8dac
authored
May 29, 2012
by
Peter Eastman
Browse files
Throw an exception if an XML tag specifies both an atom type and an atom class
parent
a43e8ece
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
wrappers/python/simtk/openmm/app/forcefield.py
wrappers/python/simtk/openmm/app/forcefield.py
+3
-1
No files found.
wrappers/python/simtk/openmm/app/forcefield.py
View file @
895f8dac
...
...
@@ -154,12 +154,14 @@ class ForceField(object):
else
:
suffix
=
str
(
i
+
1
)
classAttrib
=
'class'
+
suffix
typeAttrib
=
'type'
+
suffix
if
classAttrib
in
attrib
:
if
typeAttrib
in
attrib
:
raise
ValueError
(
'Tag specifies both a type and a class for the same atom: '
+
etree
.
tostring
(
node
))
if
attrib
[
classAttrib
]
not
in
self
.
_atomClasses
:
return
None
# Unknown atom class
types
.
append
(
self
.
_atomClasses
[
attrib
[
classAttrib
]])
else
:
typeAttrib
=
'type'
+
suffix
if
typeAttrib
not
in
attrib
or
attrib
[
typeAttrib
]
not
in
self
.
_atomTypes
:
return
None
# Unknown atom type
types
.
append
([
attrib
[
typeAttrib
]])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment