Skip to content
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

Fix axis iterators #669

Merged
merged 6 commits into from Aug 20, 2019
Merged

Conversation

jturner314
Copy link
Member

While reviewing #639, I came across some bugs in the existing implementations of AxisIter/Mut and AxisChunksIter/Mut. Specifically,

  • The .split_at() and NdProducer implementations of AxisIterCore didn't handle partially consumed iterators properly.

  • AxisChunksIter and AxisChunksIterMut didn't properly handle the chunk size being zero or the axis length being zero.

I've fixed the bugs and added tests. (Most of the tests fail before this PR, but they all pass after this PR.)

This fixes the behavior of `.split_at()` and the `NdProducer`
implementations for partially-consumed `AxisIter` or `AxisIterMut`
instances.
Now, chunk size of zero and axis length of zero are handled correctly.
Copy link
Member

@bluss bluss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@jturner314 jturner314 merged commit bc795b8 into rust-ndarray:master Aug 20, 2019
@jturner314 jturner314 deleted the fix-axis-iter branch August 20, 2019 22:50
@jturner314
Copy link
Member Author

Thanks for reviewing this @bluss!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants