OffsetArrays.jl
OffsetArrays.jl copied to clipboard
Fortran-like arrays with arbitrary, zero or negative starting indices.
In a session where OffsetArrays is a dependency of some package that I'm using, this is very strange to see: ```julia julia> zeros(10:20) 11-element OffsetArray(::Vector{Float64}, 10:20) with eltype Float64 with...
This is meant to work with https://github.com/JuliaLang/julia/pull/43552, although I think `mul!` might work without that. Alternative to #146. Since this does not overload `*`, I think it should not encounter...
This is type-piracy: https://github.com/JuliaArrays/OffsetArrays.jl/blob/d50463f9149dbe238a64be7cf8a58d904f662166/src/OffsetArrays.jl#L99
Currently, `no_offst_view` has special methods defined for `Bsae.OneTo`, but nothing for `SOneTo` axes that a `StaticArray` has. As a consequence, `OffsetArrays` doesn't realize that a `SOneTo` is 1-based. This leads...
Fix an overflow issue with broadcasting over `IdOffsetRange`, and add more methods that exist for `Base` ranges: ```julia julia> r = OffsetArrays.IdOffsetRange(3:5, -1) OffsetArrays.IdOffsetRange(values=2:4, indices=0:2) julia> r .+ big(typemax(Int)) #...
``` julia> using SparseArrays julia> using OffsetArrays: Origin julia> svec = SparseVector{Int, Int}(div(typemax(Int),2), Int[], Int[]) 4611686018427387903-element SparseVector{Int64, Int64} with 0 stored entries julia> svec .- svec 4611686018427387903-element SparseVector{Int64, Int64} with...
Fixes #273, but this will need to be tested extensively to avoid breakages. Better or more robust solutions are welcome! This PR delegates the `promote_type` operation to the parent wherever...
See https://github.com/JuliaLang/julia/issues/44939. The issue is that, because of more aggressive type promotion for arrays on nightly, ```julia ulia> [ones(2), ones(2:3)] ERROR: DimensionMismatch: axes must agree, got (Base.OneTo(2),) and (OffsetArrays.IdOffsetRange(values=2:3, indices=2:3),)...
Over at https://github.com/JuliaAstro/AstroImages.jl/issues/29#issuecomment-1024632322 we have a use case that OffsetArrays is almost perfect for. In astronomy, it's common to have physical coordinates associated with the axes of a data cube....
This is an initial attempt to start getting rid of `Requires` for ArrayInterface.