From 496293847cf4a2934772f62e58a35b83c7cbe8bc Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Thu, 14 Dec 2023 22:27:54 +0000 Subject: [PATCH] Julia v1.10 support (#153) * Julia v1.10 support * comment out untested routines --- .github/workflows/ci.yml | 1 + Project.toml | 2 +- src/InfiniteArrays.jl | 12 ++++++------ src/infarrays.jl | 1 + src/infrange.jl | 31 ++++++++++++++++++++----------- 5 files changed, 29 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04a3981..bb68b6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,7 @@ jobs: version: - '1.6' - '1' + - '~1.10.0-0' os: - ubuntu-latest - macOS-latest diff --git a/Project.toml b/Project.toml index b7167b2..8967360 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "InfiniteArrays" uuid = "4858937d-0d70-526a-a4dd-2d5cb5dd786c" -version = "0.13.3" +version = "0.13.4" [deps] ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" diff --git a/src/InfiniteArrays.jl b/src/InfiniteArrays.jl index f151212..7ff4094 100644 --- a/src/InfiniteArrays.jl +++ b/src/InfiniteArrays.jl @@ -108,18 +108,18 @@ for N=1:3 end end -for Typ in (:Number, :AbstractVector) +for Typ in (:Number, :(AbstractVector{<:Number})) @eval begin - vcat(a::$Typ, b::AbstractFill{<:Any,1,<:Tuple{OneToInf}}) = Vcat(a, b) - vcat(a::$Typ, c::CachedVector{<:Any,<:Any,<:AbstractFill{<:Any,1,<:Tuple{OneToInf}}}) = + vcat(a::$Typ, b::AbstractFill{<:Number,1,<:Tuple{OneToInf}}) = Vcat(a, b) + vcat(a::$Typ, c::CachedVector{<:Number,<:Any,<:AbstractFill{<:Any,1,<:Tuple{OneToInf}}}) = CachedArray(vcat(a, view(c.data,1:c.datasize[1])), c.array) end end -vcat(a::AbstractVector, b::AbstractVector, c::AbstractFill{<:Any,1,<:Tuple{OneToInf}}) = Vcat(vcat(a,b), c) -vcat(a::AbstractVector, b::AbstractVector, c::AbstractVector, d::AbstractFill{<:Any,1,<:Tuple{OneToInf}}) = Vcat(vcat(a,b,c), d) +vcat(a::AbstractVector{<:Number}, b::AbstractVector{<:Number}, c::AbstractFill{<:Number,1,<:Tuple{OneToInf}}) = Vcat(vcat(a,b), c) +vcat(a::AbstractVector{<:Number}, b::AbstractVector{<:Number}, c::AbstractVector{<:Number}, d::AbstractFill{<:Number,1,<:Tuple{OneToInf}}) = Vcat(vcat(a,b,c), d) -vcat(a::AbstractMatrix, b::AbstractFill{<:Any,2,<:Tuple{OneToInf,OneTo}}) = Vcat(a, b) +vcat(a::AbstractMatrix{<:Number}, b::AbstractFill{<:Number,2,<:Tuple{OneToInf,OneTo}}) = Vcat(a, b) cat_similar(A, ::Type{T}, shape::Tuple{PosInfinity}) where T = zeros(T,โˆž) cat_similar(A::AbstractArray, ::Type{T}, shape::Tuple{PosInfinity}) where T = zeros(T,โˆž) diff --git a/src/infarrays.jl b/src/infarrays.jl index b4ca863..373ef2e 100644 --- a/src/infarrays.jl +++ b/src/infarrays.jl @@ -404,6 +404,7 @@ Base._unsafe_getindex(::IndexStyle, A::AbstractVector, r::InfAxes) = layout_geti Base._unsafe_getindex(::IndexStyle, A::AbstractFill{<:Any,1}, r::InfAxes) = FillArrays._fill_getindex(A, r) getindex(A::AbstractCachedVector, r::InfAxes) = layout_getindex(A, r) # don't resize to โˆž +Base.isassigned(A::AbstractCachedVector, r::InfiniteCardinal{0}) = true getindex(A::AbstractCachedVector, r::InfiniteCardinal{0}) = A.array[r] diff --git a/src/infrange.jl b/src/infrange.jl index 75fb935..e9cc13d 100644 --- a/src/infrange.jl +++ b/src/infrange.jl @@ -516,17 +516,26 @@ getindex(c::RangeCumsum{<:Any,<:OneToInf}, k::Integer) = k * (k+1) รท 2 vcat(a::Number, r::InfRanges) = Vcat(a, r) throw_inferror() = throw(ArgumentError("vcat is undefined with a leading infinite range")) -vcat(r::InfRanges) = r -vcat(r::InfRanges{T}, args::InfRanges{T}...) where {T} = throw_inferror() -vcat(r::InfRanges, args::InfRanges...) = throw_inferror() -vcat(r::InfRanges{T}, args::AbstractRange{T}...) where {T} = throw_inferror() -vcat(r::InfRanges, args::AbstractRange...) = throw_inferror() -vcat(r::InfRanges{T}, args::AbstractVector{T}...) where {T} = throw_inferror() -vcat(r::InfRanges, args::AbstractVector...) = throw_inferror() -vcat(r::InfRanges, ::Union{Number, AbstractVector}...) = throw_inferror() -vcat(r::AbstractRange{T}, infr::InfRanges{T}) where {T} = Vcat(r, infr) -vcat(r::AbstractRange, infr::InfRanges) = Vcat(r, infr) -vcat(v::AbstractVector, infr::InfRanges) = Vcat(v, infr) +# vcat(r::InfRanges) = r +# vcat(r::InfRanges{T}, args::InfRanges{T}...) where {T} = throw_inferror() +# vcat(r::InfRanges, args::InfRanges...) = throw_inferror() +# vcat(r::InfRanges{T}, args::AbstractRange{T}...) where {T} = throw_inferror() +# vcat(r::InfRanges, args::AbstractRange...) = throw_inferror() +# vcat(r::InfRanges{T}, args::AbstractVector{T}...) where {T} = throw_inferror() +# vcat(r::InfRanges, args::AbstractVector...) = throw_inferror() +# vcat(r::InfRanges, ::Union{Number, AbstractVector}...) = throw_inferror() +# vcat(r::AbstractRange{T}, infr::InfRanges{T}) where {T} = Vcat(r, infr) +# vcat(r::AbstractRange, infr::InfRanges) = Vcat(r, infr) +# vcat(v::AbstractVector, infr::InfRanges) = Vcat(v, infr) + +vcat(r::InfRanges{<:Number}, args::AbstractVector{<:Number}...) = throw_inferror() +vcat(r::InfRanges{<:Number}) = r +vcat(r::InfRanges{<:Number}, args::AbstractRange{<:Number}...) = throw_inferror() +vcat(r::InfRanges{<:Number}, args::InfRanges{<:Number}...) = throw_inferror() +vcat(r::InfRanges{<:Number}, ::Union{Number, AbstractVector{<:Number}}...) = throw_inferror() +vcat(r::AbstractRange{T}, infr::InfRanges{T}) where {T<:Number} = Vcat(r, infr) +vcat(r::AbstractRange{<:Number}, infr::InfRanges{<:Number}) = Vcat(r, infr) +vcat(v::AbstractVector{<:Number}, infr::InfRanges{<:Number}) = Vcat(v, infr) ### # MemoryLayout