Skip to content

Conversation

mkitti
Copy link

@mkitti mkitti commented Feb 13, 2024

axes(A) should "Return a tuple of AbstractUnitRange{<:Integer}
of valid indices. The axes should be their own axes, that is
axes.(axes(A),1) == axes(A) should be satisfied."

Instead create a StarWarsArrays.axes and StarWarsArrays.eachindex

axes(A) should "Return a tuple of AbstractUnitRange{<:Integer}
of valid indices. The axes should be their own axes, that is
axes.(axes(A),1) == axes(A) should be satisfied."

Instead create a StarWarsArrays.axes and StarWarsArrays.eachindex
@mkitti
Copy link
Author

mkitti commented Feb 13, 2024

Demonstration

julia> using StarWarsArrays
Precompiling StarWarsArrays
  1 dependency successfully precompiled in 2 seconds

julia> a = StarWarsArray(1:9)
9-element view(::UnitRange{Int64}, [4, 5, 6, 1, 2, 3, 7, 8, 9]) with eltype Int64:
 4
 5
 6
 1
 2
 3
 7
 8
 9

julia> a[1]
4

julia> a[2]
5

julia> a[3]
6

julia> a[4]
1

julia> axes(a)
(Base.OneTo(9),)

julia> StarWarsArrays.axes(a)
([4, 5, 6, 1, 2, 3, 7, 8, 9],)

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

Successfully merging this pull request may close these issues.

1 participant