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
c5760245
Unverified
Commit
c5760245
authored
Sep 08, 2021
by
Peter Eastman
Committed by
GitHub
Sep 08, 2021
Browse files
Use deepcopy for cloning positions (#3241)
parent
609fc413
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
wrappers/python/openmm/app/modeller.py
wrappers/python/openmm/app/modeller.py
+2
-2
No files found.
wrappers/python/openmm/app/modeller.py
View file @
c5760245
...
...
@@ -520,7 +520,7 @@ class Modeller(object):
if
len
(
self
.
positions
)
==
0
:
positions
=
[]
else
:
positions
=
self
.
positions
.
value_in_unit
(
nanometer
)
[:]
positions
=
deepcopy
(
self
.
positions
.
value_in_unit
(
nanometer
)
)
cells
=
_CellList
(
positions
,
maxCutoff
,
vectors
,
True
)
# Create a function to compute the distance between two points, taking periodic boundary conditions into account.
...
...
@@ -1540,7 +1540,7 @@ class _CellList(object):
"""This class organizes atom positions into cells, so the neighbors of a point can be quickly retrieved"""
def
__init__
(
self
,
positions
,
maxCutoff
,
vectors
,
periodic
):
self
.
positions
=
positions
[:]
self
.
positions
=
deepcopy
(
positions
)
self
.
cells
=
{}
self
.
numCells
=
tuple
((
max
(
1
,
int
(
floor
(
vectors
[
i
][
i
]
/
maxCutoff
)))
for
i
in
range
(
3
)))
self
.
cellSize
=
tuple
((
vectors
[
i
][
i
]
/
self
.
numCells
[
i
]
for
i
in
range
(
3
)))
...
...
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