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
c8a73c91
Unverified
Commit
c8a73c91
authored
Jan 25, 2021
by
Peter Eastman
Committed by
GitHub
Jan 25, 2021
Browse files
Made ordering of impropers more deterministic (#2992)
* Made ordering of impropers more deterministic * Fixed typo
parent
9008050c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
wrappers/python/simtk/openmm/app/forcefield.py
wrappers/python/simtk/openmm/app/forcefield.py
+4
-2
wrappers/python/tests/TestForceField.py
wrappers/python/tests/TestForceField.py
+1
-1
No files found.
wrappers/python/simtk/openmm/app/forcefield.py
View file @
c8a73c91
...
...
@@ -608,6 +608,7 @@ class ForceField(object):
self
.
bondedToAtom
[
bond
.
atom2
].
add
(
bond
.
atom1
)
self
.
atomBonds
[
bond
.
atom1
].
append
(
i
)
self
.
atomBonds
[
bond
.
atom2
].
append
(
i
)
self
.
bondedToAtom
=
[
sorted
(
b
)
for
b
in
self
.
bondedToAtom
]
def
addConstraint
(
self
,
system
,
atom1
,
atom2
,
distance
):
"""Add a constraint to the system, avoiding duplicate constraints."""
...
...
@@ -989,8 +990,8 @@ class ForceField(object):
Returns
-------
bondedToAtom : list of s
e
t of int
bondedToAtom[index] is the s
e
t of atom indices bonded to atom `index`
bondedToAtom : list of
li
st of int
bondedToAtom[index] is the
li
st of atom indices bonded to atom `index`
"""
bondedToAtom
=
[]
...
...
@@ -999,6 +1000,7 @@ class ForceField(object):
for
(
atom1
,
atom2
)
in
topology
.
bonds
():
bondedToAtom
[
atom1
.
index
].
add
(
atom2
.
index
)
bondedToAtom
[
atom2
.
index
].
add
(
atom1
.
index
)
bondedToAtom
=
[
sorted
(
b
)
for
b
in
bondedToAtom
]
return
bondedToAtom
def
getUnmatchedResidues
(
self
,
topology
):
...
...
wrappers/python/tests/TestForceField.py
View file @
c8a73c91
...
...
@@ -935,7 +935,7 @@ class TestForceField(unittest.TestCase):
system1_indexes
=
[
imp1
[
0
],
imp1
[
1
],
imp1
[
2
],
imp1
[
3
]]
system2_indexes
=
[
imp2
[
0
],
imp2
[
1
],
imp2
[
2
],
imp2
[
3
]]
self
.
assertEqual
(
system1_indexes
,
[
51
,
5
6
,
54
,
5
5
])
self
.
assertEqual
(
system1_indexes
,
[
51
,
5
5
,
54
,
5
6
])
self
.
assertEqual
(
system2_indexes
,
[
51
,
55
,
54
,
56
])
def
test_ImpropersOrdering_smirnoff
(
self
):
...
...
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