You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I looked at the output of the @mtkmodel macro and tried to determine whether it is possible to provide a "default" name by defining a variable name inside. It didn't work, well that's not a problem. However, I noticed that it does, in fact, work if you then provide another name manually.
using ModelingToolkit
@mtkmodel DefaultNameModel beginbegin
name =:fooendendDefaultNameModel() # error: kw argument name not assigned
sys =DefaultNameModel(name=:bar)
sys.name ==:foo# true despite explicitly defining name
Expected behavior DefaultNameModel(name=:bar) should be called :bar, regardless of if there exists a variable name inside.
Environment (please complete the following information):
Output of using Pkg; Pkg.status()
(jl_Ebpopz) pkg> st
Status `/tmp/jl_Ebpopz/Project.toml`
[961ee093] ModelingToolkit v9.40.0
Output of using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
Describe the bug 🐞
I looked at the output of the
@mtkmodel
macro and tried to determine whether it is possible to provide a "default" name by defining a variablename
inside. It didn't work, well that's not a problem. However, I noticed that it does, in fact, work if you then provide another name manually.Expected behavior
DefaultNameModel(name=:bar)
should be called:bar
, regardless of if there exists a variablename
inside.Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: