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
c147e062
"platforms/vscode:/vscode.git/clone" did not exist on "a043fea5d14693971f3a90e2e71cf99aadd9f0a1"
Commit
c147e062
authored
Jan 01, 2016
by
John Chodera (MSKCC)
Browse files
Fix broken TestTopology test.
parent
1c603b1a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
wrappers/python/simtk/openmm/app/topology.py
wrappers/python/simtk/openmm/app/topology.py
+3
-6
wrappers/python/tests/TestTopology.py
wrappers/python/tests/TestTopology.py
+3
-0
No files found.
wrappers/python/simtk/openmm/app/topology.py
View file @
c147e062
...
@@ -373,18 +373,15 @@ class Residue(object):
...
@@ -373,18 +373,15 @@ class Residue(object):
def
bonds
(
self
):
def
bonds
(
self
):
"""Iterate over all Bonds involving any atom in this residue."""
"""Iterate over all Bonds involving any atom in this residue."""
bonds
=
[
bond
for
bond
in
self
.
chain
.
topology
.
bonds
()
if
((
bond
[
0
]
in
self
.
_atoms
)
or
(
bond
[
1
]
in
self
.
_atoms
))
]
return
(
bond
for
bond
in
self
.
chain
.
topology
.
bonds
()
if
((
bond
[
0
]
in
self
.
_atoms
)
or
(
bond
[
1
]
in
self
.
_atoms
))
)
return
iter
(
bonds
)
def
internal_bonds
(
self
):
def
internal_bonds
(
self
):
"""Iterate over all internal Bonds."""
"""Iterate over all internal Bonds."""
bonds
=
[
bond
for
bond
in
self
.
chain
.
topology
.
bonds
()
if
((
bond
[
0
]
in
self
.
_atoms
)
and
(
bond
[
1
]
in
self
.
_atoms
))
]
return
(
bond
for
bond
in
self
.
chain
.
topology
.
bonds
()
if
((
bond
[
0
]
in
self
.
_atoms
)
and
(
bond
[
1
]
in
self
.
_atoms
))
)
return
iter
(
bonds
)
def
external_bonds
(
self
):
def
external_bonds
(
self
):
"""Iterate over all Bonds to external atoms."""
"""Iterate over all Bonds to external atoms."""
bonds
=
[
bond
for
bond
in
self
.
chain
.
topology
.
bonds
()
if
((
bond
[
0
]
in
self
.
_atoms
)
!=
(
bond
[
1
]
in
self
.
_atoms
))
]
return
(
bond
for
bond
in
self
.
chain
.
topology
.
bonds
()
if
((
bond
[
0
]
in
self
.
_atoms
)
!=
(
bond
[
1
]
in
self
.
_atoms
))
)
return
iter
(
bonds
)
def
__len__
(
self
):
def
__len__
(
self
):
return
len
(
self
.
_atoms
)
return
len
(
self
.
_atoms
)
...
...
wrappers/python/tests/TestTopology.py
View file @
c147e062
...
@@ -39,6 +39,9 @@ class TestTopology(unittest.TestCase):
...
@@ -39,6 +39,9 @@ class TestTopology(unittest.TestCase):
atom_B1
=
topology
.
addAtom
(
'B1'
,
element
.
carbon
,
residue2
)
atom_B1
=
topology
.
addAtom
(
'B1'
,
element
.
carbon
,
residue2
)
atom_B2
=
topology
.
addAtom
(
'B2'
,
element
.
carbon
,
residue2
)
atom_B2
=
topology
.
addAtom
(
'B2'
,
element
.
carbon
,
residue2
)
atom_C1
=
topology
.
addAtom
(
'C1'
,
element
.
carbon
,
residue3
)
atom_C1
=
topology
.
addAtom
(
'C1'
,
element
.
carbon
,
residue3
)
topology
.
addBond
(
atom_A1
,
atom_B1
)
topology
.
addBond
(
atom_B1
,
atom_B2
)
topology
.
addBond
(
atom_B2
,
atom_C1
)
# Check bonds
# Check bonds
all_bonds
=
[
bond
for
bond
in
residue2
.
bonds
()
]
all_bonds
=
[
bond
for
bond
in
residue2
.
bonds
()
]
internal_bonds
=
[
bond
for
bond
in
residue2
.
internal_bonds
()
]
internal_bonds
=
[
bond
for
bond
in
residue2
.
internal_bonds
()
]
...
...
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