Skip to content

Commit 25665fb

Browse files
remove symtype
1 parent 3f7ab2c commit 25665fb

File tree

9 files changed

+19
-20
lines changed

9 files changed

+19
-20
lines changed

src/debugging.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ function debug_sub(ex)
3232
f = operation(ex)
3333
args = map(debug_sub, arguments(ex))
3434
f in LOGGED_FUN ? logged_fun(f, args...) :
35-
maketerm(typeof(ex), f, args, symtype(t), metadata(ex))
35+
maketerm(typeof(ex), f, args, metadata(ex))
3636
end

src/structural_transformation/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,6 @@ function simplify_shifts(var)
449449
return simplify_shifts(ModelingToolkit.Shift(t1 === nothing ? t2 : t1, s1 + s2)(vv2))
450450
else
451451
return maketerm(typeof(var), operation(var), simplify_shifts.(arguments(var)),
452-
Symbolics.symtype(var), unwrap(var).metadata)
452+
unwrap(var).metadata)
453453
end
454454
end

src/systems/abstractsystem.jl

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ function _apply_to_variables(f::F, ex) where {F}
10901090
iscall(ex) || return ex
10911091
maketerm(typeof(ex), _apply_to_variables(f, operation(ex)),
10921092
map(Base.Fix1(_apply_to_variables, f), arguments(ex)),
1093-
symtype(ex), metadata(ex))
1093+
metadata(ex))
10941094
end
10951095

10961096
abstract type SymScope end
@@ -1102,7 +1102,7 @@ function LocalScope(sym::Union{Num, Symbolic, Symbolics.Arr{Num}})
11021102
args = arguments(sym)
11031103
a1 = setmetadata(args[1], SymScope, LocalScope())
11041104
maketerm(typeof(sym), operation(sym), [a1, args[2:end]...],
1105-
symtype(sym), metadata(sym))
1105+
metadata(sym))
11061106
else
11071107
setmetadata(sym, SymScope, LocalScope())
11081108
end
@@ -1119,7 +1119,7 @@ function ParentScope(sym::Union{Num, Symbolic, Symbolics.Arr{Num}})
11191119
a1 = setmetadata(args[1], SymScope,
11201120
ParentScope(getmetadata(value(args[1]), SymScope, LocalScope())))
11211121
maketerm(typeof(sym), operation(sym), [a1, args[2:end]...],
1122-
symtype(sym), metadata(sym))
1122+
metadata(sym))
11231123
else
11241124
setmetadata(sym, SymScope,
11251125
ParentScope(getmetadata(value(sym), SymScope, LocalScope())))
@@ -1138,7 +1138,7 @@ function DelayParentScope(sym::Union{Num, Symbolic, Symbolics.Arr{Num}}, N)
11381138
a1 = setmetadata(args[1], SymScope,
11391139
DelayParentScope(getmetadata(value(args[1]), SymScope, LocalScope()), N))
11401140
maketerm(typeof(sym), operation(sym), [a1, args[2:end]...],
1141-
symtype(sym), metadata(sym))
1141+
metadata(sym))
11421142
else
11431143
setmetadata(sym, SymScope,
11441144
DelayParentScope(getmetadata(value(sym), SymScope, LocalScope()), N))
@@ -1154,7 +1154,7 @@ function GlobalScope(sym::Union{Num, Symbolic, Symbolics.Arr{Num}})
11541154
args = arguments(sym)
11551155
a1 = setmetadata(args[1], SymScope, GlobalScope())
11561156
maketerm(typeof(sym), operation(sym), [a1, args[2:end]...],
1157-
symtype(sym), metadata(sym))
1157+
metadata(sym))
11581158
else
11591159
setmetadata(sym, SymScope, GlobalScope())
11601160
end
@@ -1172,13 +1172,13 @@ function renamespace(sys, x)
11721172
if iscall(x) && operation(x) isa Operator
11731173
return maketerm(typeof(x), operation(x),
11741174
Any[renamespace(sys, only(arguments(x)))],
1175-
symtype(x), metadata(x))::T
1175+
metadata(x))::T
11761176
end
11771177
if iscall(x) && operation(x) === getindex
11781178
args = arguments(x)
11791179
return maketerm(
11801180
typeof(x), operation(x), vcat(renamespace(sys, args[1]), args[2:end]),
1181-
symtype(x), metadata(x))::T
1181+
metadata(x))::T
11821182
end
11831183
let scope = getmetadata(x, SymScope, LocalScope())
11841184
if scope isa LocalScope
@@ -1263,13 +1263,12 @@ function namespace_expr(
12631263
# metadata from the rescoped variable
12641264
rescoped = renamespace(n, O)
12651265
maketerm(typeof(rescoped), operation(rescoped), renamed,
1266-
symtype(rescoped),
12671266
metadata(rescoped))
12681267
elseif Symbolics.isarraysymbolic(O)
12691268
# promote_symtype doesn't work for array symbolics
1270-
maketerm(typeof(O), operation(O), renamed, symtype(O), metadata(O))
1269+
maketerm(typeof(O), operation(O), renamed, metadata(O))
12711270
else
1272-
maketerm(typeof(O), operation(O), renamed, symtype(O), metadata(O))
1271+
maketerm(typeof(O), operation(O), renamed, metadata(O))
12731272
end
12741273
elseif isvariable(O)
12751274
renamespace(n, O)

src/systems/clock_inference.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function substitute_sample_time(ex, dt)
6363
end
6464
new_args[i] = ex_arg
6565
end
66-
maketerm(typeof(ex), op, new_args, symtype(ex), metadata(ex))
66+
maketerm(typeof(ex), op, new_args, metadata(ex))
6767
end
6868
end
6969

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function delay_to_function(expr, iv, sts, ps, h)
238238
return maketerm(typeof(expr),
239239
operation(expr),
240240
map(x -> delay_to_function(x, iv, sts, ps, h), arguments(expr)),
241-
symtype(expr), metadata(expr))
241+
metadata(expr))
242242
else
243243
return expr
244244
end

src/systems/diffeqs/odesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ function convert_system(::Type{<:ODESystem}, sys, t; name = nameof(sys))
569569
continue
570570
end
571571
ns = maketerm(typeof(s), operation(s), Any[t],
572-
SymbolicUtils.symtype(s), SymbolicUtils.metadata(s))
572+
SymbolicUtils.metadata(s))
573573
newsts[i] = ns
574574
varmap[s] = ns
575575
else

src/systems/systemstructure.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ using SparseArrays
2020
function quick_cancel_expr(expr)
2121
Rewriters.Postwalk(quick_cancel,
2222
similarterm = (x, f, args; kws...) -> maketerm(typeof(x), f, args,
23-
SymbolicUtils.symtype(x), SymbolicUtils.metadata(x),
23+
SymbolicUtils.metadata(x),
2424
kws...))(expr)
2525
end
2626

src/utils.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ function detime_dvs(op)
3333
Sym{Real}(nameof(operation(op)))
3434
else
3535
maketerm(typeof(op), operation(op), detime_dvs.(arguments(op)),
36-
symtype(op), metadata(op))
36+
metadata(op))
3737
end
3838
end
3939

4040
function retime_dvs(op, dvs, iv)
4141
issym(op) && return Sym{FnType{Tuple{symtype(iv)}, Real}}(nameof(op))(iv)
4242
iscall(op) ?
4343
maketerm(typeof(op), operation(op), retime_dvs.(arguments(op), (dvs,), (iv,)),
44-
symtype(op), metadata(op)) :
44+
metadata(op)) :
4545
op
4646
end
4747

@@ -833,7 +833,7 @@ end
833833
function fold_constants(ex)
834834
if iscall(ex)
835835
maketerm(typeof(ex), operation(ex), map(fold_constants, arguments(ex)),
836-
symtype(ex), metadata(ex))
836+
metadata(ex))
837837
elseif issym(ex) && isconstant(ex)
838838
getdefault(ex)
839839
else

src/variables.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ ishistory(x::Symbolic) = getmetadata(x, IsHistory, false)
244244
hist(x, t) = wrap(hist(unwrap(x), t))
245245
function hist(x::Symbolic, t)
246246
setmetadata(
247-
toparam(maketerm(typeof(x), operation(x), [unwrap(t)], symtype(x), metadata(x))),
247+
toparam(maketerm(typeof(x), operation(x), [unwrap(t)], metadata(x))),
248248
IsHistory, true)
249249
end
250250

0 commit comments

Comments
 (0)