rust-ndarray / ndarray

ndarray: an N-dimensional array with array views, multidimensional slicing, and efficient operations
https://docs.rs/ndarray/
Apache License 2.0
3.62k stars 307 forks source link

iterators are confusing #1043

Open benkay86 opened 3 years ago

benkay86 commented 3 years ago

The current framework for iteration over arrays is confusing. Issue edited because it's even more confusing than at first glance!

Common scenarios for iteration include:

Users may expect some consistent idioms with regard to how these different iterators are accessed. The ArrayBase documentation is the starting point for many users. It is currently non-obvious (at least to me) that:

I may be missing it, but it appears there is no currently no way to:

There are good reasons for some of these idiosyncrasies (e.g. expeditious blanket impls), but they still steepen ndarray's learning curve. Ways to address this would include:

What are the maintainers' views on these ideas? I would be happy to contribute pull requests with some guidance.

bluss commented 3 years ago

Needs further discussion so that the underlying abstractions are clarified - I'll be a bit unreachable during the summer, but back in a bit