Skip to content

Conversation

@lohedges
Copy link
Contributor

This PR fixes a strange bug where trajectory indexing fails when attempting to save trajectory frames at a checkpoint after restarting a simulation. It appears that the issue must be related to some stale trajectory object being associated with the stream file, since calling mols.delete_all_frames() prior to the simulation fixes the error. I'm not sure why this happens, since we do delete the frames after checkpoint during the simulation and this issue doesn't occur in all cases. I've added in some safeguards to avoid this issue, i.e. we now do the following:

  • Delete frames from the copy of the system that is streamed to file.
  • Delete frames in the system used for dynamics after checkpointing.
  • Delete any existing frames in the input system prior to simulation.

closes OpenBioSim/cresset#80

@lohedges lohedges added bug Something isn't working cresset Related to work with Cresset labels Jan 28, 2026
lohedges added a commit that referenced this pull request Jan 28, 2026
@lohedges lohedges merged commit bc1c2ab into devel Jan 28, 2026
4 checks passed
@lohedges lohedges deleted the fix_trajectory_issue branch January 28, 2026 14:34
lohedges added a commit that referenced this pull request Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cresset Related to work with Cresset

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants