From c455ee25a4d908a5c369af834b0ddda678e0fff1 Mon Sep 17 00:00:00 2001 From: Tianyi Pu <44583944+putianyi889@users.noreply.github.com> Date: Fri, 16 Feb 2024 17:25:01 +0000 Subject: [PATCH 1/5] Update CircularArrays.jl --- src/CircularArrays.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CircularArrays.jl b/src/CircularArrays.jl index e7bfcf3..96e4f89 100644 --- a/src/CircularArrays.jl +++ b/src/CircularArrays.jl @@ -79,6 +79,7 @@ end @inline Base.similar(arr::CircularArray, ::Type{T}, dims::Tuple{Base.DimOrInd, Vararg{Base.DimOrInd}}) where T = _similar(arr, T, dims) # Ambiguity resolution with Base @inline Base.similar(arr::CircularArray, ::Type{T}, dims::Dims) where T = _similar(arr, T, dims) +@inline Base.similar(arr::CircularArray, ::Type{T}, dims::Tuple{Integer, Vararg{Integer}}) where T = _similar(arr, T, dims) @inline Base.similar(arr::CircularArray, ::Type{T}, dims::Tuple{Union{Integer, Base.OneTo}, Vararg{Union{Integer, Base.OneTo}}}) where T = _similar(arr, T, dims) @inline _similar(::Type{CircularArray{T,N,A}}, dims) where {T,N,A} = CircularArray{T,N}(similar(A, dims)) From 282fca315694a42a296a7f91150ed0bbdcfdc531 Mon Sep 17 00:00:00 2001 From: Tianyi Pu <44583944+putianyi889@users.noreply.github.com> Date: Fri, 16 Feb 2024 17:26:41 +0000 Subject: [PATCH 2/5] Update runtests.jl --- test/runtests.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/runtests.jl b/test/runtests.jl index baa1632..15b9b17 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -35,6 +35,7 @@ end @test @inferred(a[[1]']) isa CircularArray{Int64,2} @test @inferred(axes(a)) isa Tuple{Vararg{AbstractUnitRange}} @test @inferred(similar(a)) isa typeof(a) + @test @inferred(similar(a, size(a))) isa typeof(a) @test @inferred(similar(typeof(a), axes(a))) isa typeof(a) @test @inferred(a[a]) isa typeof(a) end From 69e2bdf26dfefe6ffdd7dbff92fa1372d7ee8fbe Mon Sep 17 00:00:00 2001 From: Tianyi Pu <44583944+putianyi889@users.noreply.github.com> Date: Fri, 16 Feb 2024 18:18:15 +0000 Subject: [PATCH 3/5] Update runtests.jl --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 15b9b17..8854eaf 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -35,7 +35,7 @@ end @test @inferred(a[[1]']) isa CircularArray{Int64,2} @test @inferred(axes(a)) isa Tuple{Vararg{AbstractUnitRange}} @test @inferred(similar(a)) isa typeof(a) - @test @inferred(similar(a, size(a))) isa typeof(a) + @test @inferred(similar(a, Float64, size(a))) isa typeof(a) @test @inferred(similar(typeof(a), axes(a))) isa typeof(a) @test @inferred(a[a]) isa typeof(a) end From 349d9492a1432a646dc58e9c697908292339e9e9 Mon Sep 17 00:00:00 2001 From: Tianyi Pu <44583944+putianyi889@users.noreply.github.com> Date: Fri, 16 Feb 2024 18:28:37 +0000 Subject: [PATCH 4/5] Update runtests.jl --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 8854eaf..0b51543 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -35,7 +35,7 @@ end @test @inferred(a[[1]']) isa CircularArray{Int64,2} @test @inferred(axes(a)) isa Tuple{Vararg{AbstractUnitRange}} @test @inferred(similar(a)) isa typeof(a) - @test @inferred(similar(a, Float64, size(a))) isa typeof(a) + @test @inferred(similar(a, Float64, size(a))) isa CircularArray{Float64} @test @inferred(similar(typeof(a), axes(a))) isa typeof(a) @test @inferred(a[a]) isa typeof(a) end From d6510ae3121bb537eee8aa217bb1a9a30efd3675 Mon Sep 17 00:00:00 2001 From: Tianyi Pu <44583944+putianyi889@users.noreply.github.com> Date: Fri, 16 Feb 2024 21:53:29 +0000 Subject: [PATCH 5/5] Update runtests.jl --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 0b51543..e366cce 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -35,7 +35,7 @@ end @test @inferred(a[[1]']) isa CircularArray{Int64,2} @test @inferred(axes(a)) isa Tuple{Vararg{AbstractUnitRange}} @test @inferred(similar(a)) isa typeof(a) - @test @inferred(similar(a, Float64, size(a))) isa CircularArray{Float64} + @test @inferred(similar(a, Float64, Int8.(size(a)))) isa CircularArray{Float64} @test @inferred(similar(typeof(a), axes(a))) isa typeof(a) @test @inferred(a[a]) isa typeof(a) end