Open Audrius-St opened 1 month ago
I don't quite understand. xb
is not a kwarg, so the error message is correct?
Well, I've not passed kwargs before, my understanding is based on reading the Julia documentation and it sounds like I've misunderstood it.
I thought the general syntax for kwargs is of the form f(x; xa=Xo, xb=Xf)
.
The error message does not mention kwargs.
I would like to evaluate
f_tpTs_nm_vec = f_tpTs_nm.(X)
for the vector X
I would like to know what I'm doing incorrectly in the build_function
that give me the error message, ERROR: LoadError: UndefVarError: xb not defined
now run for the MNWE above and given below
julia> include("test_symbolic_series.jl")
ERROR: LoadError: UndefVarError: `xb` not defined
Stacktrace:
[1] macro expansion
@ ~/.julia/packages/SymbolicUtils/qyMYa/src/code.jl:375 [inlined]
[2] macro expansion
@ ~/.julia/packages/RuntimeGeneratedFunctions/M9ZX8/src/RuntimeGeneratedFunctions.jl:163 [inlined]
[3] macro expansion
@ ./none:0 [inlined]
[4] generated_callfunc
@ ./none:0 [inlined]
[5] (::RuntimeGeneratedFunctions.RuntimeGeneratedFunction{…})(args::Float64)
@ RuntimeGeneratedFunctions ~/.julia/packages/RuntimeGeneratedFunctions/M9ZX8/src/RuntimeGeneratedFunctions.jl:150
[6] _broadcast_getindex_evalf
@ ./broadcast.jl:709 [inlined]
[7] _broadcast_getindex
@ ./broadcast.jl:682 [inlined]
[8] getindex
@ ./broadcast.jl:636 [inlined]
[9] copy
@ ./broadcast.jl:942 [inlined]
[10] materialize(bc::Base.Broadcast.Broadcasted{…})
@ Base.Broadcast ./broadcast.jl:903
[11] top-level scope
@ ~/projects/Hamiltonian/test/test_symbolic_series.jl:28
[12] include(fname::String)
@ Base.MainInclude ./client.jl:489
[13] top-level scope
@ REPL[6]:1
build_function
does not have a way to build functions with keyword arguments.
From the Symbolics.jl documentation,
build_function(ex, args...;
expression = Val{true},
target = JuliaTarget(),
parallel=nothing,
kwargs...)
can I pass xa
and xb
as kwargs...
set to Xo
and Xf
, respectively?
Or not. If yes, then I would appreciate being informed of the correct syntax. The documentation provides a definition, but no examples.
can I pass xa and xb as kwargs... set to Xo and Xf, respectively?
Those are for forwarding other keyword arguments, not for declaring new ones.
Hello,
When I attempt to use build_function with kwargs I encounter an error message that I don't understand; that one of the kwargs is not defined.
My question is what am I doing incorrectly in my use of build_function.
Below is a simplified MNWE followed by the error message.
generates the following error message stating that the kwarg
xb
is not defined