SciML / DiffEqCallbacks.jl

A library of useful callbacks for hybrid scientific machine learning (SciML) with augmented differential equation solvers
https://docs.sciml.ai/DiffEqCallbacks/stable/
Other
85 stars 44 forks source link

more CI #191

Open ArnoStrouwen opened 6 months ago

ArnoStrouwen commented 6 months ago

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
ChrisRackauckas commented 6 months ago

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

ArnoStrouwen commented 6 months ago

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

ChrisRackauckas commented 6 months ago

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

AayushSabharwal commented 6 months ago

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

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

ChrisRackauckas commented 5 months ago

This one can probably get updated?