Skip to content

Commit 22035d5

Browse files
committed
Removed attempt to support array constants.
1 parent aac6342 commit 22035d5

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

src/constants.jl

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
11
import SymbolicUtils: symtype, term, hasmetadata, issym
22
struct MTKConstantCtx end
33

4+
isconstant(x::Num) = isconstant(unwrap(x))
45
function isconstant(x)
56
x = unwrap(x)
67
x isa Symbolic && getmetadata(x, MTKConstantCtx, false)
78
end
8-
isconstant(x::Num) = isconstant(unwrap(x))
9+
910
"""
1011
toconst(s::Sym)
1112
1213
Maps the parameter to a constant. The parameter must have a default.
1314
"""
14-
function toconstant(s)
15-
if s isa Symbolics.Arr
16-
Symbolics.wrap(toconstant(Symbolics.unwrap(s)))
17-
elseif s isa AbstractArray
18-
map(toconstant, s)
19-
else
20-
hasmetadata(s, Symbolics.VariableDefaultValue) ||
21-
throw(ArgumentError("Constant `$(s)` must be assigned a default value."))
22-
setmetadata(s, MTKConstantCtx, true)
23-
end
15+
function toconstant(s::Sym)
16+
hasmetadata(s, Symbolics.VariableDefaultValue) ||
17+
throw(ArgumentError("Constant `$(s)` must be assigned a default value."))
18+
setmetadata(s, MTKConstantCtx, true)
2419
end
20+
2521
toconstant(s::Num) = wrap(toconstant(value(s)))
2622

2723
"""

src/systems/diffeqs/odesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ end
197197

198198
function ODESystem(eqs, iv = nothing; kwargs...)
199199
eqs = scalarize(eqs)
200-
# NOTE: this assumes that the order of algebric equations doesn't matter
200+
# NOTE: this assumes that the order of algebraic equations doesn't matter
201201
diffvars = OrderedSet()
202202
allstates = OrderedSet()
203203
ps = OrderedSet()

0 commit comments

Comments
 (0)