-
-
Notifications
You must be signed in to change notification settings - Fork 58
Register Interpolations for Symbolics #93
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
Conversation
@YingboMa do you know why the printing is weird? ```julia julia> using Symbolics; u = 2.0collect(1:10); t = 1.0collect(1:10); julia> A = LinearInterpolation(u,t); julia> @variables t 1-element Vector{Num}: t julia> A(t) [2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0](t) julia> Symbolics.operation(A(t)) 20-element LinearInterpolation{Vector{Float64}, Vector{Float64}, true, Float64}: 2.0 4.0 6.0 8.0 10.0 ⋮ 6.0 7.0 8.0 9.0 10.0 julia> Symbolics.arguments(A(t)) 1-element Vector{Num}: t ```
| (interp::AbstractInterpolation)(t::Number) = _interpolate(interp, t) | ||
|
|
||
| import Symbolics | ||
| Base.@pure __parameterless_type(T) = Base.typename(T).wrapper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this function used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Array{Float64} -> Array for the op name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But where is it used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point.
|
|
||
| import Symbolics | ||
| Base.@pure __parameterless_type(T) = Base.typename(T).wrapper | ||
| Base.nameof(x::AbstractInterpolation) = typeof(x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nameof should return Symbol
| import Symbolics | ||
| Base.@pure __parameterless_type(T) = Base.typename(T).wrapper | ||
| Base.nameof(x::AbstractInterpolation) = typeof(x) | ||
| Base.isbinaryoperator(::Type{T}) where T <: AbstractInterpolation = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is should be removed.
| Base.@pure __parameterless_type(T) = Base.typename(T).wrapper | ||
| Base.nameof(x::AbstractInterpolation) = typeof(x) | ||
| Base.isbinaryoperator(::Type{T}) where T <: AbstractInterpolation = false | ||
| (interp::DataInterpolations.AbstractInterpolation)(t::Symbolics.Num) = Symbolics.SymbolicUtils.term(interp,t) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs unwrap on t.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah these were all handled in #94
@YingboMa do you know why the printing is weird?