Repository navigation
Support non-periodic trajectories without box dimensions - #447
Merged
Merged
Conversation
harryswift01
marked this pull request as ready for review
October 9, 2026 15:16
jimboid
approved these changes
Oct 9, 2026
jimboid
left a comment
Member
There was a problem hiding this comment.
Fast turn around on this user reported bug. Happy with eyeballing of the numbers by Jas in the chat. Happy for this to merge and new minor release to be made on this basis.
|
Hi @harryswift01, Thank you so much for sorting this out so quickly. I’ve updated to v2.5.0 and can confirm that it’s now working perfectly on my gas-phase simulations, with no more AttributeError. I really appreciate the fast turnaround. Thanks, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR allows CodeEntropy to run on non-periodic trajectories, such as gas-phase simulations of isolated molecules. These trajectories have no box dimensions, so
merge_forcesfailed withAttributeError: 'NoneType' object has no attribute 'copy'when loading them. The axes and covariance code also assumes a box when applying the minimum image convention and unwrapping molecules, so skipping the dimensions alone would not have been enough.Changes
Handle trajectories without box dimensions:
merge_forcesnow checks whether the trajectory has box dimensions before extracting them.max(10 × largest coordinate span, 100 Å), which is far more than twice any interatomic distance, so the minimum image and unwrap steps have no effect.Add unit tests:
merge_forcespasses a per-frame box toload_newwhen the trajectory has no dimensions.Impact