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
eb1c5858
Commit
eb1c5858
authored
Nov 06, 2015
by
Peter Eastman
Browse files
Bug fix
parent
bc41b7a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
wrappers/python/simtk/openmm/app/modeller.py
wrappers/python/simtk/openmm/app/modeller.py
+2
-2
wrappers/python/tests/TestModeller.py
wrappers/python/tests/TestModeller.py
+7
-5
No files found.
wrappers/python/simtk/openmm/app/modeller.py
View file @
eb1c5858
...
...
@@ -1029,11 +1029,11 @@ class Modeller(object):
if
atom1
in
newExtraPoints
:
a1
=
newExtraPoints
[
atom1
]
else
:
a1
=
matchingAtoms
[
atom1
]
a1
=
newAtoms
[
matchingAtoms
[
atom1
]
]
if
atom2
in
newExtraPoints
:
a2
=
newExtraPoints
[
atom2
]
else
:
a2
=
matchingAtoms
[
atom2
]
a2
=
newAtoms
[
matchingAtoms
[
atom2
]
]
newTopology
.
addBond
(
a1
,
a2
)
for
bond
in
self
.
topology
.
bonds
():
...
...
wrappers/python/tests/TestModeller.py
View file @
eb1c5858
...
...
@@ -953,27 +953,29 @@ class TestModeller(unittest.TestCase):
</ForceField>"""
ff
=
ForceField
(
StringIO
(
xml
))
# Create
a
zinc atom.
# Create
two
zinc atom
s
.
topology
=
Topology
()
chain
=
topology
.
addChain
()
residue
=
topology
.
addResidue
(
'ZN'
,
chain
)
topology
.
addAtom
(
'ZN'
,
element
.
zinc
,
residue
)
residue
=
topology
.
addResidue
(
'ZN'
,
chain
)
topology
.
addAtom
(
'ZN'
,
element
.
zinc
,
residue
)
# Add the extra particles.
modeller
=
Modeller
(
topology
,
[
Vec3
(
0.5
,
1.0
,
1.5
)]
*
nanometers
)
modeller
=
Modeller
(
topology
,
[
Vec3
(
0.5
,
1.0
,
1.5
)
,
Vec3
(
2.0
,
2.0
,
0.0
)
]
*
nanometers
)
modeller
.
addExtraParticles
(
ff
)
top
=
modeller
.
topology
pos
=
modeller
.
positions
# Check that the correct particles were added.
self
.
assertEqual
(
len
(
pos
),
5
)
self
.
assertEqual
(
len
(
pos
),
10
)
for
i
,
atom
in
enumerate
(
top
.
atoms
()):
self
.
assertEqual
(
element
.
zinc
if
i
==
0
else
None
,
atom
.
element
)
self
.
assertEqual
(
element
.
zinc
if
i
in
(
0
,
5
)
else
None
,
atom
.
element
)
# Check that the
ir
positions are reasonable.
# Check that the positions
in the first residue
are reasonable.
center
=
Vec3
(
0.5
,
1.0
,
1.5
)
*
nanometers
self
.
assertEqual
(
center
,
modeller
.
positions
[
0
])
...
...
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