-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
DSL doesn't allow @species
to be assigned default values and metadata when using begin ... end
syntax
#1054
Comments
This seems to actually be a Symbolics.jl bug. These work: using ModelingToolkit
t = ModelingToolkit.t_nounits
@variables u(t)=1 [input = true, disturbance = true]
@variables begin
u(t) = 1
end
@parameters begin
a = 1
end
@parameters begin
a = 1, [input = true, description = "true"]
end but this errors julia> @variables begin
u(t) = 1, [input = true]
end
ERROR: syntax: misplaced assignment statement in "[input = true]" around REPL[37]:1
Stacktrace:
[1] top-level scope
@ REPL[37]:1 as does julia> @parameters begin
u(t)=1, [input=true]
end
ERROR: syntax: misplaced assignment statement in "[input = true]" around REPL[61]:1
Stacktrace:
[1] top-level scope
@ REPL[61]:1 |
This requires someone to update |
@jonathanfischer97 these seem fixed if you use ModelingToolkit master now. Can you double check on your end? |
This now works for me using the latest Catalyst, MTK, and Symbolics releases, so I am going to close this. Feel free to reopen if that is not the case for you. |
Thank you guys! |
Can't assign default value AND include species metadata within
@species
begin
blockTrying to define this reaction network, where
begin ... end
block syntaxE(t)
is given a default value as well as metadata (description, tunable)will generate the following error:
Combination of
begin
block, default species assignment, and extra metadata produce the errorIt seems this is a problem with how the DSL is parsing the new
begin
block syntax.Using this syntax and giving a default value, OR metadata, doesn't seem to produce an error. Only the combination of these two specie specifications within a
begin
block produces the error.Additionally, it only affects the
@species
block, not@parameters
species
, and uses both for the@parameters
, doesn't error.Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
The text was updated successfully, but these errors were encountered: