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
4341179c
Commit
4341179c
authored
Jan 05, 2016
by
peastman
Browse files
Merge pull request #1322 from swails/py3
Python 3 does not have dict.itervalues
parents
7b778da3
40cdd7f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
wrappers/python/simtk/openmm/app/forcefield.py
wrappers/python/simtk/openmm/app/forcefield.py
+2
-2
No files found.
wrappers/python/simtk/openmm/app/forcefield.py
View file @
4341179c
...
@@ -778,7 +778,7 @@ def _findAtomMatches(atoms, template, bondedTo, externalBonds, matches, hasMatch
...
@@ -778,7 +778,7 @@ def _findAtomMatches(atoms, template, bondedTo, externalBonds, matches, hasMatch
def
_findMatchErrors
(
forcefield
,
res
):
def
_findMatchErrors
(
forcefield
,
res
):
"""Try to guess why a residue failed to match any template and return an error message."""
"""Try to guess why a residue failed to match any template and return an error message."""
residueCounts
=
_countResidueAtoms
([
atom
.
element
for
atom
in
res
.
atoms
()])
residueCounts
=
_countResidueAtoms
([
atom
.
element
for
atom
in
res
.
atoms
()])
numResidueAtoms
=
sum
(
residueCounts
.
iter
values
())
numResidueAtoms
=
sum
(
residueCounts
.
values
())
numResidueHeavyAtoms
=
sum
(
residueCounts
[
element
]
for
element
in
residueCounts
if
element
not
in
(
None
,
elem
.
hydrogen
))
numResidueHeavyAtoms
=
sum
(
residueCounts
[
element
]
for
element
in
residueCounts
if
element
not
in
(
None
,
elem
.
hydrogen
))
# Loop over templates and see how closely each one might match.
# Loop over templates and see how closely each one might match.
...
@@ -797,7 +797,7 @@ def _findMatchErrors(forcefield, res):
...
@@ -797,7 +797,7 @@ def _findMatchErrors(forcefield, res):
# If there are too many missing atoms, discard this template.
# If there are too many missing atoms, discard this template.
numTemplateAtoms
=
sum
(
templateCounts
.
iter
values
())
numTemplateAtoms
=
sum
(
templateCounts
.
values
())
numTemplateHeavyAtoms
=
sum
(
templateCounts
[
element
]
for
element
in
templateCounts
if
element
not
in
(
None
,
elem
.
hydrogen
))
numTemplateHeavyAtoms
=
sum
(
templateCounts
[
element
]
for
element
in
templateCounts
if
element
not
in
(
None
,
elem
.
hydrogen
))
if
numTemplateAtoms
>
numBestMatchAtoms
:
if
numTemplateAtoms
>
numBestMatchAtoms
:
continue
continue
...
...
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