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
cee3b812
Unverified
Commit
cee3b812
authored
Nov 11, 2017
by
peastman
Committed by
GitHub
Nov 11, 2017
Browse files
Merge pull request #1932 from peastman/contiguous
Require atoms and residues to be contiguous
parents
33e2c3cd
d4c9eb1d
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 @
cee3b812
...
...
@@ -154,6 +154,8 @@ class Topology(object):
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
:
id
=
str
(
self
.
_numResidues
+
1
)
residue
=
Residue
(
name
,
self
.
_numResidues
,
chain
,
id
)
...
...
@@ -181,6 +183,8 @@ class Topology(object):
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
:
id
=
str
(
self
.
_numAtoms
+
1
)
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