Spaces:
Running
Running
avoid slow reading of long MD trajectory
Browse files- mlip_arena/tasks/md.py +2 -3
mlip_arena/tasks/md.py
CHANGED
@@ -309,10 +309,9 @@ def run(
|
|
309 |
|
310 |
if restart and traj_file.exists():
|
311 |
try:
|
312 |
-
|
313 |
-
last_atoms = traj[-1]
|
314 |
assert isinstance(last_atoms, Atoms)
|
315 |
-
last_step = last_atoms.info.get("step"
|
316 |
n_steps -= last_step
|
317 |
traj = Trajectory(traj_file, "a", atoms)
|
318 |
atoms.set_positions(last_atoms.get_positions())
|
|
|
309 |
|
310 |
if restart and traj_file.exists():
|
311 |
try:
|
312 |
+
last_atoms = read(traj_file, index="-1")
|
|
|
313 |
assert isinstance(last_atoms, Atoms)
|
314 |
+
last_step = last_atoms.info.get("step")
|
315 |
n_steps -= last_step
|
316 |
traj = Trajectory(traj_file, "a", atoms)
|
317 |
atoms.set_positions(last_atoms.get_positions())
|