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
7f41337f
"vscode:/vscode.git/clone" did not exist on "f08268fc3242f8a8b69db4b4a19595083a4dddf2"
Unverified
Commit
7f41337f
authored
Jun 21, 2023
by
Peter Eastman
Committed by
GitHub
Jun 21, 2023
Browse files
Fixed edge case in Modeller._CellList (#4120)
parent
3ef12991
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
wrappers/python/openmm/app/modeller.py
wrappers/python/openmm/app/modeller.py
+3
-1
No files found.
wrappers/python/openmm/app/modeller.py
View file @
7f41337f
...
...
@@ -1623,11 +1623,13 @@ class _CellList(object):
return
tuple
((
int
(
floor
(
pos
[
j
]
/
self
.
cellSize
[
j
]))
%
self
.
numCells
[
j
]
for
j
in
range
(
3
)))
def
neighbors
(
self
,
pos
):
processedCells
=
set
()
offsets
=
(
-
1
,
0
,
1
)
for
i
in
offsets
:
for
j
in
offsets
:
for
k
in
offsets
:
cell
=
self
.
cellForPosition
(
Vec3
(
pos
[
0
]
+
i
*
self
.
cellSize
[
0
],
pos
[
1
]
+
j
*
self
.
cellSize
[
1
],
pos
[
2
]
+
k
*
self
.
cellSize
[
2
]))
if
cell
in
self
.
cells
:
if
cell
in
self
.
cells
and
cell
not
in
processedCells
:
processedCells
.
add
(
cell
)
for
atom
in
self
.
cells
[
cell
]:
yield
atom
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