-
Notifications
You must be signed in to change notification settings - Fork 245
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
kwarg appears to be a syntax error for derivative of interpolant #486
base: master
Are you sure you want to change the base?
Conversation
When using the doc-recommended syntax for the derivative of the interpolation I obtain a syntax error: ``` julia> sol(0.0,deriv=Val{1}) ERROR: MethodError: no method matching (::ODESolution{Float64, 1, Vector{Float64}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Float64}}, ODEProblem{Float64, Tuple{Float64, Float64}, false, SciMLBase.NullParameters, ODEFunction{false, typeof(f), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5, OrdinaryDiffEq.InterpolationData{ODEFunction{false, typeof(f), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, Vector{Float64}, Vector{Vector{Float64}}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, DiffEqBase.DEStats})(::Float64, ::Type{Val{0}}; deriv=Val{1}) Use square brackets [] for indexing an Array. Closest candidates are: (::ODESolution)(::Any, ::Any, ::Type; idxs, continuity) at /Users/nathompson7/.julia/packages/SciMLBase/cU5k7/src/solutions/ode_solutions.jl:19 got unsupported keyword argument "deriv" (::ODESolution)(::Real, ::Any, ::AbstractVector{<:Integer}, ::Any) at /Users/nathompson7/.julia/packages/SciMLBase/cU5k7/src/solutions/ode_solutions.jl:32 got unsupported keyword argument "deriv" (::ODESolution)(::Real, ::Any, ::AbstractVector, ::Any) at /Users/nathompson7/.julia/packages/SciMLBase/cU5k7/src/solutions/ode_solutions.jl:55 got unsupported keyword argument "deriv" ... Stacktrace: [1] kwerr(::NamedTuple{(:deriv,), Tuple{DataType}}, ::ODESolution{Float64, 1, Vector{Float64}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Float64}}, ODEProblem{Float64, Tuple{Float64, Float64}, false, SciMLBase.NullParameters, ODEFunction{false, typeof(f), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5, OrdinaryDiffEq.InterpolationData{ODEFunction{false, typeof(f), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, Vector{Float64}, Vector{Vector{Float64}}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, DiffEqBase.DEStats}, ::Float64, ::Type) @ Base ./error.jl:163 [2] top-level scope @ REPL[20]:1 ``` Removing the `kwarg` fixes the issue: ``` julia> sol(0.0,Val{1}) 0.505 ```
@@ -90,7 +90,7 @@ sol(t) | |||
Note that the interpolating function allows for `t` to be a vector and uses this to speed up the interpolation calculations. The full API for the interpolations is | |||
|
|||
```julia | |||
sol(t,deriv=Val{0};idxs=nothing,continuity=:left) |
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.
that's not a kwarg: it's before the ;
. That's an optional argument.
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.
Ok. However, does the syntax work for you?
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.
yes, sol(t,Val{0})
works
When using the doc-recommended syntax for the derivative of the interpolation I obtain a syntax error:
Removing the
kwarg
fixes the issue:Extra information: