Conversation
update to HEAD
Codecov Report
@@ Coverage Diff @@
## develop #2815 +/- ##
===========================================
- Coverage 92.22% 92.22% -0.01%
===========================================
Files 184 184
Lines 24140 24139 -1
Branches 3122 3122
===========================================
- Hits 22262 22261 -1
Misses 1813 1813
Partials 65 65
Continue to review full report at Codecov.
|
| raise StopIteration() | ||
|
|
||
| def next(self): | ||
| return self.__next__() |
There was a problem hiding this comment.
The next method is not needed anymore. See pep-3114. I know we are not very good in following this pattern.
There was a problem hiding this comment.
If we backport this fix to 1.0.1 #2798 , will we need to add next() back for Python 2.7?
There was a problem hiding this comment.
next() still functions here from ProtoReader definition.
There was a problem hiding this comment.
Than we should leave the next function and remove it once from all readers.
| def test_next_after_frame_numbering(self, universe): | ||
| universe.trajectory[98] # index is 0-based and frames are 0-based | ||
| universe.trajectory.next() | ||
| assert_equal(universe.trajectory.frame, 99, "wrong frame number") |
|
Not really sure why the CI is not running on this PR.... EDIT (5s later): now it does. Sorry for the noise. |
|
Thanks a lot @yuxuanzhuang ! |
* Fixes #2814 * changes in ChainReader: * new `_read_frame` and `__iter__` are now properly connected (previously, they moved independently, which could lead to the ChainReader being in an inconsistent state) * remove `_chained_iterator`. * add `__next__` * add an extra attribute `__current_frame` to internally monitor absolute current frame * add tests * update CHANGELOG
* Fixes #2814 * changes in ChainReader: * new `_read_frame` and `__iter__` are now properly connected (previously, they moved independently, which could lead to the ChainReader being in an inconsistent state) * remove `_chained_iterator`. * add `__next__` * add an extra attribute `__current_frame` to internally monitor absolute current frame * add tests * update CHANGELOG
* Fixes MDAnalysis#2814 * changes in ChainReader: * new `_read_frame` and `__iter__` are now properly connected (previously, they moved independently, which could lead to the ChainReader being in an inconsistent state) * remove `_chained_iterator`. * add `__next__` * add an extra attribute `__current_frame` to internally monitor absolute current frame * add tests * update CHANGELOG
Fixes #2814
Changes made in this Pull Request:
_read_frameand__iter__are connected._chained_iterator.__next__toChainReader.current_frameto internally monitor absolute current frame.PR Checklist