Skip to content

Conversation

@ChrisRackauckas
Copy link
Member

@YingboMa do you know why the printing is weird?

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

@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
```
@ChrisRackauckas ChrisRackauckas merged commit c5c63b3 into master Nov 2, 2021
@ChrisRackauckas ChrisRackauckas deleted the symbolics branch November 2, 2021 15:10
(interp::AbstractInterpolation)(t::Number) = _interpolate(interp, t)

import Symbolics
Base.@pure __parameterless_type(T) = Base.typename(T).wrapper
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

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)
Copy link
Member

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
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs unwrap on t.

Copy link
Member Author

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

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.

4 participants