-
-
Notifications
You must be signed in to change notification settings - Fork 231
Closed
Description
As far as I can tell, this isn't possible right now:
@parameters p = 0.5
p.val.metadata[Symbolics.VariableDefaultValue] = 0.6
ERROR: MethodError: no method matching setindex!(::Base.ImmutableDict{DataType, Any}, ::Float64, ::Type{Symbolics.VariableDefaultValue})
because the metadata are immutable:
julia> p.val.metadata
Base.ImmutableDict{DataType, Any} with 3 entries:
MTKVariableTypeCtx => PARAMETER
VariableSource => (:parameters, :p)
VariableDefaultValue => 0.5
Context where this is useful:
I have a parameter at global scope. I have two functions, each representing two different physical processes A, B. They both utilize the same parameter, which itself is also utilized in other unrelated processes C. However, in my A, B the parameter should have a different starting value (while of course in all cases A, B, C the parameter covers the same physical range). I cannot use the same parameter everywhere and have its default value be context-specific. But I would like to!
TorkelE and jonathanfischer97
Metadata
Metadata
Assignees
Labels
No labels