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

refactor!: remove indexing dispatches and add dispatch for higher order derivatives with Symbolics #247

Merged
merged 7 commits into from
May 6, 2024

Conversation

sathvikbhagavan
Copy link
Member

@sathvikbhagavan sathvikbhagavan commented May 6, 2024

If AbstractVector subtyping is not removed, We get errors like:

julia> df2 = expand_derivatives(D2(f(τ)))
ERROR: Differentiation with array expressions is not yet supported
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] occursin_info
    @ ~/.julia/packages/Symbolics/Eas9m/src/diff.jl:67 [inlined]
  [3] (::Symbolics.var"#254#256"{SymbolicUtils.BasicSymbolic{Real}, SymbolicUtils.BasicSymbolic{Real}})(a::LinearInterpolation{Vector{Float64}, Vector{Float64}, true, Float64})
    @ Symbolics ~/.julia/packages/Symbolics/Eas9m/src/diff.jl:100
  [4] iterate
    @ ./generator.jl:47 [inlined]
  [5] _collect(c::Vector{Any}, itr::Base.Generator{Vector{…}, Symbolics.var"#254#256"{…}}, ::Base.EltypeUnknown, isz::Base.HasShape{1})
    @ Base ./array.jl:854
  [6] collect_similar
    @ ./array.jl:763 [inlined]
  [7] map
    @ ./abstractarray.jl:3285 [inlined]
  [8] occursin_info(x::SymbolicUtils.BasicSymbolic{Real}, expr::SymbolicUtils.BasicSymbolic{Real}, fail::Bool)
    @ Symbolics ~/.julia/packages/Symbolics/Eas9m/src/diff.jl:100
  [9] occursin_info(x::SymbolicUtils.BasicSymbolic{Real}, expr::SymbolicUtils.BasicSymbolic{Real})
    @ Symbolics ~/.julia/packages/Symbolics/Eas9m/src/diff.jl:65
 [10] expand_derivatives(O::SymbolicUtils.BasicSymbolic{Real}, simplify::Bool; occurrences::Nothing)
    @ Symbolics ~/.julia/packages/Symbolics/Eas9m/src/diff.jl:177
 [11] expand_derivatives
    @ ~/.julia/packages/Symbolics/Eas9m/src/diff.jl:171 [inlined]
 [12] expand_derivatives(O::SymbolicUtils.BasicSymbolic{Real})
    @ Symbolics ~/.julia/packages/Symbolics/Eas9m/src/diff.jl:171
 [13] top-level scope
    @ REPL[12]:1
Some type information was truncated. Use `show(err)` to see complete types.

EDIT: This is indeed breaking.

Also fixes: #240

@ChrisRackauckas
Copy link
Member

It is breaking but nothing is relying on it. Let's do it. Remove the indexing overloads as well, and the type parameter associated with it. I.e. Fix #240

@sathvikbhagavan sathvikbhagavan changed the title refactor: add dispatch for higher order derivatives with Symbolics refactor!: remove indexing dispatches and add dispatch for higher order derivatives with Symbolics May 6, 2024
@ChrisRackauckas ChrisRackauckas merged commit 62749c6 into SciML:master May 6, 2024
12 checks passed
@sathvikbhagavan sathvikbhagavan deleted the sb/sym_second_order branch May 7, 2024 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data interpolation unexpectedly behaves like a vector
2 participants