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
d4c9eb1d
Commit
d4c9eb1d
authored
Nov 10, 2017
by
Peter Eastman
Browse files
Require atoms and residues to be contiguous
parent
33e2c3cd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
wrappers/python/simtk/openmm/app/topology.py
wrappers/python/simtk/openmm/app/topology.py
+4
-0
No files found.
wrappers/python/simtk/openmm/app/topology.py
View file @
d4c9eb1d
...
@@ -154,6 +154,8 @@ class Topology(object):
...
@@ -154,6 +154,8 @@ class Topology(object):
Residue
Residue
the newly created Residue
the newly created Residue
"""
"""
if
len
(
chain
.
_residues
)
>
0
and
self
.
_numResidues
!=
chain
.
_residues
[
-
1
].
index
+
1
:
raise
ValueError
(
'All residues within a chain must be contiguous'
)
if
id
is
None
:
if
id
is
None
:
id
=
str
(
self
.
_numResidues
+
1
)
id
=
str
(
self
.
_numResidues
+
1
)
residue
=
Residue
(
name
,
self
.
_numResidues
,
chain
,
id
)
residue
=
Residue
(
name
,
self
.
_numResidues
,
chain
,
id
)
...
@@ -181,6 +183,8 @@ class Topology(object):
...
@@ -181,6 +183,8 @@ class Topology(object):
Atom
Atom
the newly created Atom
the newly created Atom
"""
"""
if
len
(
residue
.
_atoms
)
>
0
and
self
.
_numAtoms
!=
residue
.
_atoms
[
-
1
].
index
+
1
:
raise
ValueError
(
'All atoms within a residue must be contiguous'
)
if
id
is
None
:
if
id
is
None
:
id
=
str
(
self
.
_numAtoms
+
1
)
id
=
str
(
self
.
_numAtoms
+
1
)
atom
=
Atom
(
name
,
element
,
self
.
_numAtoms
,
residue
,
id
)
atom
=
Atom
(
name
,
element
,
self
.
_numAtoms
,
residue
,
id
)
...
...
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