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
bc90b216
Commit
bc90b216
authored
Mar 19, 2013
by
Peter Eastman
Browse files
Throw exception if an atom type is defined twice
parent
248e8883
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
wrappers/python/simtk/openmm/app/forcefield.py
wrappers/python/simtk/openmm/app/forcefield.py
+4
-1
No files found.
wrappers/python/simtk/openmm/app/forcefield.py
View file @
bc90b216
...
@@ -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.
...
...
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