From 549a1d9ef2dd5e5919b2472bcb14f15faff34861 Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 27 Sep 2023 11:39:19 +0200 Subject: [PATCH 1/8] test 1.6 --- .github/workflows/ci.yml | 1 + src/array/array.jl | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57cc562db..c54323a7a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,7 @@ jobs: matrix: version: - '1' + - '1.6' os: - ubuntu-latest - macOS-latest diff --git a/src/array/array.jl b/src/array/array.jl index 7e32b7bb9..a4d5997b7 100644 --- a/src/array/array.jl +++ b/src/array/array.jl @@ -255,12 +255,14 @@ for (d, s) in ((:AbstractDimArray, :AbstractDimArray), end end # Ambiguity -Base.copyto!(dst::AbstractDimArray{T,2}, src::SparseArrays.CHOLMOD.Dense{T}) where T<:Union{Float64,ComplexF64} = - copyto!(parent(dst), src) -Base.copyto!(dst::AbstractDimArray{T}, src::SparseArrays.CHOLMOD.Dense{T}) where T<:Union{Float64,ComplexF64} = - copyto!(parent(dst), src) -Base.copyto!(dst::DimensionalData.AbstractDimArray, src::SparseArrays.CHOLMOD.Dense) = - copyto!(parent(dst), src) +@static if VERSION >= v"1.8.0" + Base.copyto!(dst::AbstractDimArray{T,2}, src::SparseArrays.CHOLMOD.Dense{T}) where T<:Union{Float64,ComplexF64} = + copyto!(parent(dst), src) + Base.copyto!(dst::AbstractDimArray{T}, src::SparseArrays.CHOLMOD.Dense{T}) where T<:Union{Float64,ComplexF64} = + copyto!(parent(dst), src) + Base.copyto!(dst::DimensionalData.AbstractDimArray, src::SparseArrays.CHOLMOD.Dense) = + copyto!(parent(dst), src) +end Base.copyto!(dst::AbstractDimArray{T,2} where T, src::SparseArrays.AbstractSparseMatrixCSC) = copyto!(parent(dst), src) Base.copyto!(dst::AbstractDimArray{T,2} where T, src::LinearAlgebra.AbstractQ) = From 8def094a8e9df2ed9dcf58d79f6ba51b15b5fe5c Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 27 Sep 2023 13:30:32 +0200 Subject: [PATCH 2/8] makie in extras --- Project.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 45769fc74..bd56996a2 100644 --- a/Project.toml +++ b/Project.toml @@ -41,7 +41,7 @@ RecipesBase = "0.7, 0.8, 1" Statistics = "1" TableTraits = "1" Tables = "1" -julia = "1.6" +julia = "1.8" [extras] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" @@ -54,6 +54,7 @@ Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" ImageFiltering = "6a3955dd-da59-5b1f-98d4-e7296123deb5" ImageTransformations = "02fcd773-0e25-5acc-982a-7f6622650795" +Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" From 763aa9a1e2e87073075c1078d3058797aeab92d6 Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 27 Sep 2023 13:32:09 +0200 Subject: [PATCH 3/8] cholmod on 1.9 --- src/array/array.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/array/array.jl b/src/array/array.jl index a4d5997b7..958ed2084 100644 --- a/src/array/array.jl +++ b/src/array/array.jl @@ -255,7 +255,7 @@ for (d, s) in ((:AbstractDimArray, :AbstractDimArray), end end # Ambiguity -@static if VERSION >= v"1.8.0" +@static if VERSION >= v"1.9.0" Base.copyto!(dst::AbstractDimArray{T,2}, src::SparseArrays.CHOLMOD.Dense{T}) where T<:Union{Float64,ComplexF64} = copyto!(parent(dst), src) Base.copyto!(dst::AbstractDimArray{T}, src::SparseArrays.CHOLMOD.Dense{T}) where T<:Union{Float64,ComplexF64} = From e0805a55015f37563ea38e17debf12401a6de491 Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 27 Sep 2023 20:56:35 +0200 Subject: [PATCH 4/8] move ambiguity --- src/array/array.jl | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/array/array.jl b/src/array/array.jl index 958ed2084..72d096c53 100644 --- a/src/array/array.jl +++ b/src/array/array.jl @@ -262,28 +262,27 @@ end copyto!(parent(dst), src) Base.copyto!(dst::DimensionalData.AbstractDimArray, src::SparseArrays.CHOLMOD.Dense) = copyto!(parent(dst), src) + Base.copyto!(dst::SparseArrays.AbstractCompressedVector, src::AbstractDimArray{T, 1} where T) = + copyto!(dst, parent(src)) + Base.copyto!(dst::AbstractDimArray{T,2} where T, src::SparseArrays.AbstractSparseMatrixCSC) = + copyto!(parent(dst), src) + Base.copyto!(dst::AbstractDimArray{T,2} where T, src::LinearAlgebra.AbstractQ) = + copyto!(parent(dst), src) + function Base.copyto!( + dst::AbstractDimArray{<:Any,2}, + dst_i::CartesianIndices{2, R} where R<:Tuple{OrdinalRange{Int64, Int64}, OrdinalRange{Int64, Int64}}, + src::SparseArrays.AbstractSparseMatrixCSC{<:Any}, + src_i::CartesianIndices{2, R} where R<:Tuple{OrdinalRange{Int64, Int64}, OrdinalRange{Int64, Int64}} + ) + copyto!(parent(dst), dst_i, src, src_i) + end + Base.copy!(dst::SparseArrays.AbstractCompressedVector{T}, src::AbstractDimArray{T, 1}) where T = + copy!(dst, parent(src)) + Base.copy!(dst::SparseArrays.SparseVector, src::AbstractDimArray{T,1}) where T = + copy!(dst, parent(src)) end -Base.copyto!(dst::AbstractDimArray{T,2} where T, src::SparseArrays.AbstractSparseMatrixCSC) = - copyto!(parent(dst), src) -Base.copyto!(dst::AbstractDimArray{T,2} where T, src::LinearAlgebra.AbstractQ) = - copyto!(parent(dst), src) -Base.copyto!(dst::SparseArrays.AbstractCompressedVector, src::AbstractDimArray{T, 1} where T) = - copyto!(dst, parent(src)) Base.copyto!(dst::PermutedDimsArray, src::AbstractDimArray) = copyto!(dst, parent(src)) -function Base.copyto!( - dst::AbstractDimArray{<:Any,2}, - dst_i::CartesianIndices{2, R} where R<:Tuple{OrdinalRange{Int64, Int64}, OrdinalRange{Int64, Int64}}, - src::SparseArrays.AbstractSparseMatrixCSC{<:Any}, - src_i::CartesianIndices{2, R} where R<:Tuple{OrdinalRange{Int64, Int64}, OrdinalRange{Int64, Int64}} -) - copyto!(parent(dst), dst_i, src, src_i) -end - -Base.copy!(dst::SparseArrays.SparseVector, src::AbstractDimArray{T,1}) where T = - copy!(dst, parent(src)) -Base.copy!(dst::SparseArrays.AbstractCompressedVector{T}, src::AbstractDimArray{T, 1}) where T = - copy!(dst, parent(src)) ArrayInterface.parent_type(::Type{<:AbstractDimArray{T,N,D,A}}) where {T,N,D,A} = A From 0f7c0edb5243505e6d429019c1a84ec37abd1ed0 Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 27 Sep 2023 21:08:08 +0200 Subject: [PATCH 5/8] only Aqua on recent versions --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 88e6a6d32..8a565dabf 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,6 +1,6 @@ using DimensionalData, Aqua, SafeTestsets -if VERSION >= v"1.5.0" +if VERSION >= v"1.9.0" Aqua.test_ambiguities([DimensionalData, Base, Core]) Aqua.test_unbound_args(DimensionalData) Aqua.test_undefined_exports(DimensionalData) From 322c01181f2425e51c69a391ea40bc8d1dfe8853 Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 27 Sep 2023 21:32:35 +0200 Subject: [PATCH 6/8] 1.6 syntax in tests --- test/indexing.jl | 6 +++--- test/methods.jl | 2 +- test/selector.jl | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/indexing.jl b/test/indexing.jl index 91e7bc08d..f1103122c 100644 --- a/test/indexing.jl +++ b/test/indexing.jl @@ -549,7 +549,7 @@ end A2 = DimArray(p, (X, Y, t2)) A3 = DimArray(p, (X, Y, t3)) - @test view(A1, Ti(5)) == [5;;] - @test view(A2, Ti(5)) == [5;;] - @test view(A3, Ti(5)) == [5;;] + @test view(A1, Ti(5)) == permutedims([5]) + @test view(A2, Ti(5)) == permutedims([5]) + @test view(A3, Ti(5)) == permutedims([5]) end diff --git a/test/methods.jl b/test/methods.jl index 440e2bb48..9bcaa4cd5 100644 --- a/test/methods.jl +++ b/test/methods.jl @@ -532,7 +532,7 @@ end dc = DimArray(c, X(4.0:5.0)) dd = DimArray(c, X(8.0:9.0)) - @test hcat(da) == [1; 2;;] + @test hcat(da) == permutedims([1 2]) @test dims(hcat(da)) == dims(cat(da; dims=2)) == (X(Sampled(4.0:5.0, ForwardOrdered(), Regular(1.0), Points(), NoMetadata())), AnonDim(NoLookup(Base.OneTo(1)))) diff --git a/test/selector.jl b/test/selector.jl index c447b5483..f81fe9596 100644 --- a/test/selector.jl +++ b/test/selector.jl @@ -1130,7 +1130,7 @@ end A3 = A[X=Not(At([1.0,3.0]))] @test lookup(A2, :Ti) == [6u"s", 11u"s"] @test lookup(A3, :X) == [5.0,7.0,9.0] - @test A1 == [3; 6; 12; 15;;] + @test A1 == permutedims([3 6 12 15]) @test lookup(A1, Ti) == [11u"s"] @test lookup(A1, X) == [1.0, 3.0, 7.0, 9.0] end From 46016945c8c8d63440da7a5f740932b19a5468a8 Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 27 Sep 2023 22:21:53 +0200 Subject: [PATCH 7/8] need sparse copyto --- src/array/array.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/array/array.jl b/src/array/array.jl index 72d096c53..7499b406e 100644 --- a/src/array/array.jl +++ b/src/array/array.jl @@ -278,9 +278,9 @@ end end Base.copy!(dst::SparseArrays.AbstractCompressedVector{T}, src::AbstractDimArray{T, 1}) where T = copy!(dst, parent(src)) - Base.copy!(dst::SparseArrays.SparseVector, src::AbstractDimArray{T,1}) where T = - copy!(dst, parent(src)) end +Base.copy!(dst::SparseArrays.SparseVector, src::AbstractDimArray{T,1}) where T = + copy!(dst, parent(src)) Base.copyto!(dst::PermutedDimsArray, src::AbstractDimArray) = copyto!(dst, parent(src)) From 61d81a5f26ffb7b7f970d485115d36399909c833 Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 27 Sep 2023 23:40:02 +0200 Subject: [PATCH 8/8] testing 1.6 is too hard --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c54323a7a..57cc562db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,6 @@ jobs: matrix: version: - '1' - - '1.6' os: - ubuntu-latest - macOS-latest