Skip to content

3.4.1 -> 3.4.2 breaking #341

@j-fu

Description

@j-fu

Some methods for AbstracDiffEqArray are broken since 3.4.2
Before, it was possible to calculate e.g. a maximum of an instance
of a subtype of AbstractDiffEqArray.

** MRE: **

using RecursiveArrayTools
using Test

abstract type AbstractTransientSolution{T, N, A, B} <: AbstractDiffEqArray{T, N, A} end

mutable struct TransientSolution{T, N, A, B} <: AbstractTransientSolution{T, N, A, B}
    u::A
    t::B
end

function TransientSolution(vec::AbstractVector{T}, ts, ::NTuple{N}) where {T, N}
    TransientSolution{T, N, typeof(vec), typeof(ts)}(vec, ts)
end

TransientSolution(vec::AbstractVector, ts::AbstractVector) = TransientSolution(vec, ts, (size(vec[1])..., length(vec)))

times=range(0,1,length=11)
tsol1d=TransientSolution([rand(20) for t in times],times)
tsol2d=TransientSolution([rand(2,20) for t in times],times)

@testset "mwe" begin
    @test maximum(tsol1d)>0
    @test maximum(tsol2d)>0
end

** Error for first test: **

Test threw exception
Expression: maximum(tsol1d) > 0
ArgumentError: number of indices (1) must match the parent dimensionality (2)
Stacktrace:
[1] check_parent_index_match(parent::TransientSolution{Vector{Float64}, 2, Vector{Vector{Float64}}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}, ::Tuple{Bool})
@ Base ./subarray.jl:43
[2] check_parent_index_match(parent::TransientSolution{Vector{Float64}, 2, Vector{Vector{Float64}}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}, indices::Tuple{Base.Slice{Base.OneTo{Int64}}})
@ Base ./subarray.jl:41
[3] SubArray
@ ./subarray.jl:21 [inlined]
[4] SubArray
@ ./subarray.jl:32 [inlined]
[5] view
@ ~/.julia/packages/RecursiveArrayTools/SkCK5/src/vector_of_array.jl:514 [inlined]
[6] mapreduce(f::Function, op::Function, A::TransientSolution{Vector{Float64}, 2, Vector{Vector{Float64}}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}; kwargs::@Kwargs{})
@ RecursiveArrayTools ~/.julia/packages/RecursiveArrayTools/SkCK5/src/vector_of_array.jl:689
[7] mapreduce(f::Function, op::Function, A::TransientSolution{Vector{Float64}, 2, Vector{Vector{Float64}}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}})
@ RecursiveArrayTools ~/.julia/packages/RecursiveArrayTools/SkCK5/src/vector_of_array.jl:688
[8] maximum(a::TransientSolution{Vector{Float64}, 2, Vector{Vector{Float64}}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}; kw::@Kwargs{})
@ Base ./reduce.jl:764

** Error for second test: **

Test threw exception
Expression: maximum(tsol2d) > 0
UndefVarError: `J` not defined
Stacktrace:
[1] view
@ ~/.julia/packages/RecursiveArrayTools/SkCK5/src/vector_of_array.jl:513 [inlined]
[2] mapreduce(f::Function, op::Function, A::TransientSolution{Matrix{Float64}, 3, Vector{Matrix{Float64}}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}; kwargs::@Kwargs{})
@ RecursiveArrayTools ~/.julia/packages/RecursiveArrayTools/SkCK5/src/vector_of_array.jl:689
[3] mapreduce(f::Function, op::Function, A::TransientSolution{Matrix{Float64}, 3, Vector{Matrix{Float64}}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}})
@ RecursiveArrayTools ~/.julia/packages/RecursiveArrayTools/SkCK5/src/vector_of_array.jl:688
[4] maximum(a::TransientSolution{Matrix{Float64}, 3, Vector{Matrix{Float64}}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}; kw::@Kwargs{})
@ Base ./reduce.jl:764

Environment (please complete the following information):

  • Output of using Pkg; Pkg.status()
⌃ [731186ca] RecursiveArrayTools v3.4.2
   [8dfed614] Test
  • Output of using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
Status `~/Wias/work/julia/dev/VoronoiFVM/eee/Manifest.toml`
[79e6a3ab] Adapt v4.0.1
[4fba245c] ArrayInterface v7.7.0
[9a962f9c] DataAPI v1.16.0
[e2d170a0] DataValueInterfaces v1.0.0
[ffbed154] DocStringExtensions v0.9.3
[46192b85] GPUArraysCore v0.1.6
[82899510] IteratorInterfaceExtensions v1.0.0
[bac558e1] OrderedCollections v1.6.3
[aea7be01] PrecompileTools v1.2.0
[21216c6a] Preferences v1.4.1
[3cdcf5f2] RecipesBase v1.3.4
⌃ [731186ca] RecursiveArrayTools v3.4.2
[ae029012] Requires v1.3.0
[1e83bf80] StaticArraysCore v1.4.2
[2efcf032] SymbolicIndexingInterface v0.3.3
[3783bdb8] TableTraits v1.0.1
[bd369af6] Tables v1.11.1
[56f22d72] Artifacts
[2a0f44e3] Base64
[ade2ca70] Dates
[b77e0a4c] InteractiveUtils
[76f85450] LibGit2
[8f399da3] Libdl
[37e2e46d] LinearAlgebra
[56ddb016] Logging
[d6f4376e] Markdown
[ca575930] NetworkOptions v1.2.0
[de0858da] Printf
[9a3f8284] Random
[ea8e919c] SHA v0.7.0
[9e88b42a] Serialization
[2f01184e] SparseArrays v1.10.0
[10745b16] Statistics v1.10.0
[4607b0f0] SuiteSparse
[fa267f1f] TOML v1.0.3
[8dfed614] Test
[cf7118a7] UUIDs
[4ec0a83e] Unicode
[e66e0078] CompilerSupportLibraries_jll v1.0.5+1
[e37daf67] LibGit2_jll v1.6.4+0
[29816b5a] LibSSH2_jll v1.11.0+1
[c8ffd9c3] MbedTLS_jll v2.28.2+1
[4536629a] OpenBLAS_jll v0.3.23+2
[bea87d4a] SuiteSparse_jll v7.2.1+1
[8e850b90] libblastrampoline_jll v5.8.0+1
  • Output of versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 20 × 13th Gen Intel(R) Core(TM) i7-13700H
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, goldmont)
Threads: 1 on 20 virtual cores
Environment:
LD_LIBRARY_PATH = /home/fuhrmann/local/lib64:/home/fuhrmann/local/lib:/usr/local/cuda-12.3/lib64:.:/usr/local/lib64:/usr/local/lib:/home/fuhrmann/local/lib:/home/fuhrmann/Sys/share/pardiso
JULIA_PKG_DEVDIR = /home/fuhrmann/Wias/work/julia/dev
JULIA_PKG_SERVER_REGISTRY_PREFERENCE = eager
JULIA_PROJECT = .
JULIA_VERSION = 1.10.0
JULIA_HISTORY = /home/fuhrmann/.julia_histories/_home_fuhrmann_Wias_work_julia_dev_VoronoiFVM_eee

Additional context

Things are still working on 3.4.1

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions