Closed DhairyaLGandhi closed 2 months ago
Attention: Patch coverage is 0%
with 20 lines
in your changes are missing coverage. Please review.
Project coverage is 31.64%. Comparing base (
1238b2b
) to head (071ad2f
). Report is 11 commits behind head on master.
Files | Patch % | Lines |
---|---|---|
ext/SciMLBaseZygoteExt.jl | 0.00% | 18 Missing :warning: |
ext/SciMLBaseChainRulesCoreExt.jl | 0.00% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Add a test?
Yes, I wanted to open this to gauge feedback and see breakages downstream.
No breakages downstream.
There seem to be a lot of failures because of some rate limits being hit with codecov
Downstream currently has a failure from the RealInput guesses change. Can you confirm the relevant downstream tests are passing locally for you?
I do see a failure in a clean env, checking
ERROR: LoadError: MethodError: no method matching _getindex(::ODESolution{…}, ::NotSymbolic, ::Vector{…})
Closest candidates are:
_getindex(::AbstractVectorOfArray{T, N}, ::NotSymbolic, ::Colon...) where {T<:Number, N}
@ RecursiveArrayTools ~/arpa/jsmo/RecursiveArrayTools.jl/src/vector_of_array.jl:307
_getindex(::AbstractVectorOfArray{T, N}, ::NotSymbolic, ::Colon...) where {T, N}
@ RecursiveArrayTools ~/arpa/jsmo/RecursiveArrayTools.jl/src/vector_of_array.jl:296
_getindex(::AbstractVectorOfArray{T, N}, ::NotSymbolic, ::AbstractArray{Bool}, Colon...) where {T, N}
@ RecursiveArrayTools ~/arpa/jsmo/RecursiveArrayTools.jl/src/vector_of_array.jl:313
...
That was a typo, and in the process I also figured that some of the rrules
in SciMLBaseChainRulesExt were using old SII syntax, so I updated those too.
The added tests pass for me locally.
This seems to also "just work" for getu
:
julia> gxy = getu(prob, [sys.x, sys.y])
julia> gradsii = Zygote.gradient(sol) do sol
sum(sum.(gxy(sol)))
end
julia> gradidx = Zygote.gradient(sol) do sol
sum(sum.(sol[[sys.x, sys.y]]))
end
julia> gradidx[1] == gradsii[1]
true
Might be because I'm on https://github.com/SciML/SymbolicIndexingInterface.jl/pull/72
"Just works" for getu makes sense with these changes. Thanks for checking as well!
@ChrisRackauckas thoughts on merging?
Checklist
Additional context
Before this PR, indexing with vector of symbols fails at the check for symbolic variables at https://github.com/SciML/SciMLBase.jl/blob/9d87ca04a15f6f94a2f3362f91a95a66950003ae/ext/SciMLBaseZygoteExt.jl#L111 and returns
This PR:
Requires https://github.com/SciML/RecursiveArrayTools.jl/pull/367