Skip to content

Commit b9dabd2

Browse files
committed
copy timestep
this avoids that ts points to the same reference in a loop.
1 parent aaa5fa7 commit b9dabd2

File tree

1 file changed

+2
-1
lines changed
  • package/MDAnalysis/coordinates

1 file changed

+2
-1
lines changed

package/MDAnalysis/coordinates/DCD.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ def _read_next_timestep(self, ts=None):
167167
if self._frame == self.n_frames - 1:
168168
raise IOError('trying to go over trajectory limit')
169169
if ts is None:
170-
ts = self.ts
170+
# use a copy to avoid that ts always points to the same reference
171+
ts = self.ts.copy()
171172
frame = self._file.read()
172173
self._frame += 1
173174
ts = self._frame_to_ts(frame, ts)

0 commit comments

Comments
 (0)