Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test 1.6 #542

Merged
merged 8 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
49 changes: 25 additions & 24 deletions src/array/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,33 +255,34 @@ 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)
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)
@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} =
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))
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))
Base.copyto!(dst::PermutedDimsArray, src::AbstractDimArray) =
copyto!(dst, parent(src))

ArrayInterface.parent_type(::Type{<:AbstractDimArray{T,N,D,A}}) where {T,N,D,A} = A

Expand Down
6 changes: 3 additions & 3 deletions test/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion test/methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/selector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading