-
Notifications
You must be signed in to change notification settings - Fork 659
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure NoJump handles jumps that occur on the second frame in NPT tra…
…jectories (#4258) * Ensure atoms are unwrapped correctly when they jump across boundaries on the second frame Previosuly, jumps wouldn't be unwrapped until the third frame due to the way the class was initialised. To fix the issue, the NoJump transformation now requires an 'ag' argument, which is used to determine the box size at the first frame * Add testfiles for nojump transformation * Add tests for nojump transformation where the jump occurs at the second and third frames Also update other tests to pass the 'ag' argument to the transformation * Remove unncessary second assignment of L in NoJump initialisation * Temporarily put test datafiles in the test directory * Add transformation to set variable box dimensions For creating NPT trajectories * Use set_variable_dimensions transformation in test for NoJump * Remove the test datafiles for the npt NoJump * Import set_variable_dimensions in the transformation sub-package * Fix typos in docsttring of set_variable_dimensions transformation * remove unncessary comments in docstring of npt tests for nojump * Add tests for set_variable_dimensions transformation * Add test to check that set_variable_dimensions raises an error when dimensions are missing for a frame * Tidy formatting of set_variable_dimensions test functions * Add docs for set_variable_dimensions * Add versionchanged note to NoJump about adding 'ag' argument * Add test to check if the nojump transform always returns the correct values at all frames when iterating over multiple times * ensure coordinates can be unwrapped correctly when iterating over the trajectory multiple times * Use tmp_path_factory to write tmp trajectory for testing NoJump repeated unwrapping Also don't pass 'ag' argument to NoJump in tests * Fix typo in boxdimensions module docstring Co-authored-by: Hugo MacDermott-Opeskin <[email protected]> * Fix typo in docstring of NoJump test Co-authored-by: Hugo MacDermott-Opeskin <[email protected]> * remove unnecessary second calculation of Linverse from NoJump * Add a versionadded note to the set_variable_dimensions docstring * Update CHANGELOG * Remove added set_variable_dimensions class Incorportate the functionality into set_dimensions * Update tests to reflect removal of set_variable_dimensions transformation * Update CHANGELOG * Update NoJump tests to reflect removal of set_variable_dimensions transformation * Remove unnecessary whitespace from NoJump tests Co-authored-by: Irfan Alibay <[email protected]> * Use numpy array in docstring example of set_dimensions transformation * Update changelog * Use ValueError rather than NoDataError in set_dimensions * Set NoJump.older_frame to -1 when ts.frame == 0. It can be set to any number, just not 'A'. * Add comment to explain how we ensure jumps on the second frame are handled correctly by NoJump * Make flake8 happy * Remove unnecessary if-block 'if self.prev is None:' from NoJump This will never be true * Add test to check warning is emitted by NoJump when iterating trajectory with stride > 1 * Fix formatting of set_dimensions docstring Co-authored-by: Irfan Alibay <[email protected]> --------- Co-authored-by: Hugo MacDermott-Opeskin <[email protected]> Co-authored-by: Irfan Alibay <[email protected]>
- Loading branch information
1 parent
2acd594
commit f50a097
Showing
6 changed files
with
288 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.