apply selection and scaling with current box after delta in jumps has been cached or calculated directly. this should fix using nojump on NPT simulations #6
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/nojump_and_npt_caching"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Analysing NPT simulations with .nojump lead to wrong coordinates. The issue was that caching was the default and that the cached values were already multiplied by the box matrix for the requested frame. Since box sizes change during NPT, using the cached result lead to accumulating displacements.
The new version simply does the multiplication afterwards and the cache only saves the delta in raw jumps.
Code to test this is with the old version before this fix:
import mdevaluate as md
traj = md.open('/data/robin/sim/fst_tip4p2005/T170_tb_q-14_P-850_NPT', trajectory='out/traj.xtc')
nojump = traj.nojump
last0 = nojump[-1] # result for no cache yet
[nojump[i] for i in range(0,len(nojump), 10)] # fill cache and accumulate mistakes
last1 = nojump[-1] # wrong result
del nojump.frames._nojump_cache # reset cache
last2 = nojump[-1] # again result for no cache
print((last0 == last2).all()) # should be True
print((last1 == last2).all()) # should be False in the old version and True in the new one
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.