Open rs1909 opened 1 year ago
Unfortunately this one is kinda on OffsetArrays
for not returning an OffsetArray
when indexing.
julia> oa = OffsetArray([1, 2, 3, 4], -1)
4-element OffsetArray(::Vector{Int64}, 0:3) with eltype Int64 with indices 0:3:
1
2
3
4
julia> b = oa[0:2]
3-element Vector{Int64}:
1
2
3
julia> b[0]
ERROR: BoundsError: attempt to access 3-element Vector{Int64} at index [0]
Stacktrace:
[1] getindex(A::Vector{Int64}, i1::Int64)
@ Base ./array.jl:924
[2] top-level scope
@ REPL[15]:1
There's nothing we could really do other than make OffsetArrays
a dependency and maintain methods specifically for it.
An OffsetArrays
extension would be nice
I can put OffsetArrays into a ComponentArray, but the offsets are not preserved: