-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iterating SingleFrame readers does not call rewind() #3423
Comments
I would like to label this issue a defect. I don't think that a fix is a API change because the behavior was never intended or documented as such. I would consider a fix a fix for the API that makes the SingleFrameReaders behave consistent with the existing API. |
If anyone disagrees please chime in. (Note that if it's not a defect then we can only change it in 3.0 because under semantic versioning it would be a breaking API change.) |
I'm on board with calling this a defect. There is however a possibility that folks may have unknowingly been relying on this behaviour, so we should make sure we advertise the change well. |
Note that PR #3642 fixes the undefined behavior to rewind before iteration. |
Fixes #3423 ## Work done in this PR * Rewind singleframe before on iter call * add documentation on rewinding after iteration - Trajectory API - FrameIterators * fix failing RDF test - use in-memory trajectory to make local coordinate patches permanent for tests (after rewind) - use function-scoped fixtures instead of module-scoped to safely be able to patch coordinates * fixed missing copy of convert_units=False in Reader.copy() - update SingleFrameReaderBase.copy() - update ReaderBase.copy() - bug was uncovered after tests for TestGROReaderNoConversion::test_transformations_copy failed: with the fix, the original tests pass again TOGETHER with the other changes in PR #3642 Co-authored-by: Oliver Beckstein <orbeckst@gmail.com>
Indirectly related to #3416
Expected behavior
All readers should behave similarly.
Actual behavior
See: #3415 (comment)
Iterating a SingleFrame reader does not rewind the reader, which means that any modified coordinates remain the same. This differs in behaviour from the trajectory readers which do rewind (and therefore update positions).
Code to reproduce the behavior
Current version of MDAnalysis
python -c "import MDAnalysis as mda; print(mda.__version__)"
) developpython -V
)? 3.8The text was updated successfully, but these errors were encountered: