DiffEqCallbacks.jl icon indicating copy to clipboard operation
DiffEqCallbacks.jl copied to clipboard

more CI

Open ArnoStrouwen opened this issue 2 years ago • 5 comments

RAT deprecation message is incorrect here for the manifold tests.

julia> sol[88]
┌ Warning: `Base.getindex(A::AbstractDiffEqArray, i::Int)` is deprecated, use `Base.getindex(A, :, i)` instead.
│   caller = top-level scope at REPL[26]:1
└ @ Core REPL[26]:1
2×2 Matrix{Float64}:
 0.355718  0.355718
 1.36903   1.36903

julia> sol[end]
┌ Warning: Linear indexing of `AbstractVectorOfArray` is deprecated. Change `A[i]` to `A.u[i]`
│   caller = top-level scope at REPL[27]:1
└ @ Core REPL[27]:1
┌ Warning: `Base.getindex(A::AbstractDiffEqArray, i::Int)` is deprecated, use `Base.getindex(A, :, i)` instead.
│   caller = top-level scope at REPL[27]:1
└ @ Core REPL[27]:1
2×2 Matrix{Float64}:
 0.355718  0.355718
 1.36903   1.36903

julia> sol[:,88]
2×2 Matrix{Float64}:
 0.355718  0.355718
 1.36903   1.36903

julia> sol[:,end]
2×2 Matrix{Float64}:
 1.17331   1.17331
 0.789515  0.789515

ArnoStrouwen avatar Jan 11 '24 18:01 ArnoStrouwen

That is correct. sol[88] and sol[end] are what are deprecated.

ChrisRackauckas avatar Jan 12 '24 01:01 ChrisRackauckas

88 is the end. Yet the result is not the same.

ArnoStrouwen avatar Jan 12 '24 04:01 ArnoStrouwen

I see what's going on here.

┌ Warning: Base.getindex(A::AbstractDiffEqArray, i::Int) is deprecated, use Base.getindex(A, :, i) instead. │ caller = top-level scope at REPL[27]:1 └ @ Core REPL[27]:1

That depwarn is just wrong because A.u[end] is not a vector. sol[:,end] should give a boundserror @AayushSabharwal

ChrisRackauckas avatar Jan 12 '24 09:01 ChrisRackauckas

That's a bit of a tricky one. sol[:, end] lowers to sol[:, lastindex(sol, 2)]. Are we sure no one uses lastindex(sol, i)?

How indexing works for VoA is

  • sol[x]: deprecated, falls back to sol.u[:, x]
  • sol[<all colons>] turns sol into an Array
  • sol[x::CartesianIndex] uses the last index in x for sol.u and the rest for sol.u[first(x)]
  • sol[x::AnythingElse...] uses the last index in x for sol.u and the rest for sol.u[first(x)]

However lastindex(VA, d) = last(axes(VA, d)) so it looks like VA[:, end] doesn't really work when the subarrays aren't vectors. We could just update the depwarn to tell people to use as many Colon()s as dims - 1

AayushSabharwal avatar Jan 12 '24 12:01 AayushSabharwal

This one can probably get updated?

ChrisRackauckas avatar Feb 27 '24 07:02 ChrisRackauckas