JuliaArrays / AxisArrays.jl

Performant arrays where each dimension can have a named axis with values
http://JuliaArrays.github.io/AxisArrays.jl/latest/
Other
200 stars 41 forks source link

Fix iteration over Axis #160

Closed coroa closed 5 years ago

coroa commented 5 years ago

Iterate over elements in the Axis instead of just returning the axis. Is in line with axes(Ax) = OneTo(<length of elems>) and length(Ax) = <length of elems>.

Also add Iterator{Size,Eltype} traits.

No tests are broken (that worked before).

Does this make sense?

timholy commented 5 years ago

Those lines are a bit puzzling. Added in 8cb003b0. Do you remember why @Evizero?

coroa commented 5 years ago

Before the transition to 0.7, Axis didn't implement any iteration interface. To my knowledge, the currently implemented interface does not serve any purpose.

I would like to fix that by, either

  1. Forwarding iteration to the encapsulated type (this PR), or
  2. Removing the iteration functions, alltogether

What's the next steps?