-
-
Notifications
You must be signed in to change notification settings - Fork 233
[WIP] refactor: update to SymbolicUtils@4 and Symbolics@7 #3953
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
JuliaFormatter
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/systems/connectors.jl
Line 1118 in bf11961
SymbolicUtils.promote_symtype(::typeof(instream_rt), ::Type{T}, ::Type{S}, ::Type{R}) where {T, S, R} = Real |
[JuliaFormatter] reported by reviewdog 🐶
[JuliaFormatter] reported by reviewdog 🐶
const MaybeArrayIndexT = Union{Int, UnitRange{Int}, Base.ReshapedArray{Int, N, UnitRange{Int}} where {N}} |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/systems/index_cache.jl
Lines 114 to 115 in bf11961
parse_callbacks_for_discretes!(cevs, disc_param_callbacks, constant_buffers, nonnumeric_buffers, 0) | |
parse_callbacks_for_discretes!(devs, disc_param_callbacks, constant_buffers, nonnumeric_buffers, length(cevs)) |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/systems/index_cache.jl
Line 130 in bf11961
push!(disc_syms_by_symtype_by_partition[i], filter(==(partition) ∘ Base.Fix1(getindex, disc_param_callbacks), buffer)) |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/systems/index_cache.jl
Line 163 in bf11961
push!(disc_buffer_templates, map(Base.Fix1(BufferTemplate, symtype) ∘ length, disc_syms_by_partition)) |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/systems/index_cache.jl
Lines 298 to 301 in bf11961
BSImpl.Term(; f, args) => begin | |
f === getindex && (idx = get(disc_idxs, args[1], nothing)) !== nothing | |
end | |
_ => false |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/systems/index_cache.jl
Line 370 in bf11961
function parse_callbacks_for_discretes!(events::Vector, disc_param_callbacks::Dict{SymbolicT, BitSet}, constant_buffers::Dict{TypeT, Set{SymbolicT}}, nonnumeric_buffers::Dict{TypeT, Set{SymbolicT}}, offset::Int) |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/systems/index_cache.jl
Line 445 in bf11961
function SymbolicIndexingInterface.parameter_index(ic::IndexCache, sym::Union{Num, Symbolics.Arr, Symbolics.CallAndWrap}) |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/systems/index_cache.jl
Line 501 in bf11961
function check_index_map(idxmap::Dict{SymbolicT, V}, sym::SymbolicT)::Union{V, Nothing} where {V} |
[JuliaFormatter] reported by reviewdog 🐶
mask[i] = !iscall(eq.rhs) || operation(eq.rhs) !== StructuralTransformations.change_origin |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/systems/system.jl
Line 282 in bf11961
if (checks isa Bool && checks === true || checks isa Int && (checks & CheckComponents) > 0) && iv !== nothing |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/systems/system.jl
Line 448 in bf11961
[JuliaFormatter] reported by reviewdog 🐶
fullvars[i], discmap; filterer = Symbolics.FPSubFilterer{Union{Sample, Hold, Pre}}())) |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 36 in bf11961
issym(op) && return SSym(nameof(op); type = FnType{Tuple{symtype(iv)}, Real}, shape = SU.ShapeVecT())(iv) |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 193 in bf11961
BSImpl.Term(; f) && if f isa Differential end => begin |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 288 in bf11961
function process_variables!(var_to_name::Dict{Symbol, SymbolicT}, defs::SymmapT, guesses::SymmapT, vars::Vector{SymbolicT}) |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 328 in bf11961
BSImpl.Term(; f, args) && if f === getindex end => args[1] |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 399 in bf11961
hasmetadata(x, VariableSource) || iscall(x) && operation(x) === getindex && isvariable(arguments(x)[1])::Bool |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 543 in bf11961
function collect_scoped_vars!(unknowns::OrderedSet{SymbolicT}, parameters::OrderedSet{SymbolicT}, sys::AbstractSystem, iv::Union{SymbolicT, Nothing}; depth = 1, op = Differential) |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 626 in bf11961
BSImpl.Term(; f) && if f isa O end => true |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 635 in bf11961
BSImpl.Term(; f) && if f isa Operator end => f isa O |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 654 in bf11961
function collect_vars!(unknowns::OrderedSet{SymbolicT}, parameters::OrderedSet{SymbolicT}, expr::SymbolicT, iv::Union{SymbolicT, Nothing}; depth = 0, op = Symbolics.Operator) |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 672 in bf11961
function collect_vars!(unknowns::OrderedSet{SymbolicT}, parameters::OrderedSet{SymbolicT}, expr::AbstractArray{SymbolicT}, iv::Union{SymbolicT, Nothing}; depth = 0, op = Symbolics.Operator) |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 724 in bf11961
check_scope_depth(getmetadata(var, SymScope, LocalScope())::AllScopes, depth) || return nothing |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/variables.jl
Line 198 in bf11961
iscall(x) && operation(x) === getindex && return safe_getmetadata(m, arguments(x)[1], default) |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/variables.jl
Line 259 in bf11961
BSImpl.Term(; f, args, shape, type, metadata) && if f isa Operator end => begin |
[JuliaFormatter] reported by reviewdog 🐶
ModelingToolkit.jl/src/variables.jl
Line 621 in bf11961
getunshifted(x::SymbolicT) = Symbolics.getmetadata(x, VariableUnshifted, nothing)::Union{SymbolicT, Nothing} |
fold1 = Val{false}() | ||
using SymbolicUtils | ||
using SymbolicUtils: shape | ||
using Symbolics | ||
@syms x y f(t) q[1:5] | ||
SymbolicUtils.Sym{SymReal}(:a; type = Real, shape = SymbolicUtils.ShapeVecT()) | ||
x + y | ||
x * y | ||
x / y | ||
x ^ y | ||
x ^ 5 | ||
6 ^ x | ||
x - y | ||
-y | ||
2y | ||
z = 2 | ||
dict = SymbolicUtils.ACDict{VartypeT}() | ||
dict[x] = 1 | ||
dict[y] = 1 | ||
type::typeof(DataType) = rand() < 0.5 ? Real : Float64 | ||
nt = (; type, shape, unsafe = true) | ||
Base.pairs(nt) | ||
BSImpl.AddMul{VartypeT}(1, dict, SymbolicUtils.AddMulVariant.MUL; type, shape = SymbolicUtils.ShapeVecT(), unsafe = true) | ||
*(y, z) | ||
*(z, y) | ||
SymbolicUtils.symtype(y) | ||
f(x) | ||
(5x / 5) | ||
expand((x + y) ^ 2) | ||
simplify(x ^ (1//2) + (sin(x) ^ 2 + cos(x) ^ 2) + 2(x + y) - x - y) | ||
ex = x + 2y + sin(x) | ||
rules1 = Dict(x => y) | ||
rules2 = Dict(x => 1) | ||
Dx = Differential(x) | ||
Differential(y)(ex) | ||
uex = unwrap(ex) | ||
Symbolics.executediff(Dx, uex) | ||
# Running `fold = Val(true)` invalidates the precompiled statements | ||
# for `fold = Val(false)` and itself doesn't precompile anyway. | ||
# substitute(ex, rules1) | ||
substitute(ex, rules1; fold = fold1) | ||
substitute(ex, rules2; fold = fold1) | ||
@variables foo | ||
f(foo) | ||
@variables x y f(::Real) q[1:5] | ||
x + y | ||
x * y | ||
x / y | ||
x ^ y | ||
x ^ 5 | ||
# 6 ^ x | ||
x - y | ||
-y | ||
2y | ||
symtype(y) | ||
z = 2 | ||
*(y, z) | ||
*(z, y) | ||
f(x) | ||
(5x / 5) | ||
[x, y] | ||
[x, f, f] | ||
promote_type(Int, Num) | ||
promote_type(Real, Num) | ||
promote_type(Float64, Num) | ||
# expand((x + y) ^ 2) | ||
# simplify(x ^ (1//2) + (sin(x) ^ 2 + cos(x) ^ 2) + 2(x + y) - x - y) | ||
ex = x + 2y + sin(x) | ||
rules1 = Dict(x => y) | ||
# rules2 = Dict(x => 1) | ||
# Running `fold = Val(true)` invalidates the precompiled statements | ||
# for `fold = Val(false)` and itself doesn't precompile anyway. | ||
# substitute(ex, rules1) | ||
substitute(ex, rules1; fold = fold1) | ||
Symbolics.linear_expansion(ex, y) | ||
# substitute(ex, rules2; fold = fold1) | ||
# substitute(ex, rules2) | ||
# substitute(ex, rules1; fold = fold2) | ||
# substitute(ex, rules2; fold = fold2) | ||
q[1] | ||
q'q | ||
using ModelingToolkit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
fold1 = Val{false}() | |
using SymbolicUtils | |
using SymbolicUtils: shape | |
using Symbolics | |
@syms x y f(t) q[1:5] | |
SymbolicUtils.Sym{SymReal}(:a; type = Real, shape = SymbolicUtils.ShapeVecT()) | |
x + y | |
x * y | |
x / y | |
x ^ y | |
x ^ 5 | |
6 ^ x | |
x - y | |
-y | |
2y | |
z = 2 | |
dict = SymbolicUtils.ACDict{VartypeT}() | |
dict[x] = 1 | |
dict[y] = 1 | |
type::typeof(DataType) = rand() < 0.5 ? Real : Float64 | |
nt = (; type, shape, unsafe = true) | |
Base.pairs(nt) | |
BSImpl.AddMul{VartypeT}(1, dict, SymbolicUtils.AddMulVariant.MUL; type, shape = SymbolicUtils.ShapeVecT(), unsafe = true) | |
*(y, z) | |
*(z, y) | |
SymbolicUtils.symtype(y) | |
f(x) | |
(5x / 5) | |
expand((x + y) ^ 2) | |
simplify(x ^ (1//2) + (sin(x) ^ 2 + cos(x) ^ 2) + 2(x + y) - x - y) | |
ex = x + 2y + sin(x) | |
rules1 = Dict(x => y) | |
rules2 = Dict(x => 1) | |
Dx = Differential(x) | |
Differential(y)(ex) | |
uex = unwrap(ex) | |
Symbolics.executediff(Dx, uex) | |
# Running `fold = Val(true)` invalidates the precompiled statements | |
# for `fold = Val(false)` and itself doesn't precompile anyway. | |
# substitute(ex, rules1) | |
substitute(ex, rules1; fold = fold1) | |
substitute(ex, rules2; fold = fold1) | |
@variables foo | |
f(foo) | |
@variables x y f(::Real) q[1:5] | |
x + y | |
x * y | |
x / y | |
x ^ y | |
x ^ 5 | |
# 6 ^ x | |
x - y | |
-y | |
2y | |
symtype(y) | |
z = 2 | |
*(y, z) | |
*(z, y) | |
f(x) | |
(5x / 5) | |
[x, y] | |
[x, f, f] | |
promote_type(Int, Num) | |
promote_type(Real, Num) | |
promote_type(Float64, Num) | |
# expand((x + y) ^ 2) | |
# simplify(x ^ (1//2) + (sin(x) ^ 2 + cos(x) ^ 2) + 2(x + y) - x - y) | |
ex = x + 2y + sin(x) | |
rules1 = Dict(x => y) | |
# rules2 = Dict(x => 1) | |
# Running `fold = Val(true)` invalidates the precompiled statements | |
# for `fold = Val(false)` and itself doesn't precompile anyway. | |
# substitute(ex, rules1) | |
substitute(ex, rules1; fold = fold1) | |
Symbolics.linear_expansion(ex, y) | |
# substitute(ex, rules2; fold = fold1) | |
# substitute(ex, rules2) | |
# substitute(ex, rules1; fold = fold2) | |
# substitute(ex, rules2; fold = fold2) | |
q[1] | |
q'q | |
using ModelingToolkit | |
fold1 = Val{false}() | |
using SymbolicUtils | |
using SymbolicUtils: shape | |
using Symbolics | |
@syms x y f(t) q[1:5] | |
SymbolicUtils.Sym{SymReal}(:a; type = Real, shape = SymbolicUtils.ShapeVecT()) | |
x + y | |
x * y | |
x / y | |
x ^ y | |
x ^ 5 | |
6 ^ x | |
x - y | |
-y | |
2y | |
z = 2 | |
dict = SymbolicUtils.ACDict{VartypeT}() | |
dict[x] = 1 | |
dict[y] = 1 | |
type::typeof(DataType) = rand() < 0.5 ? Real : Float64 | |
nt = (; type, shape, unsafe = true) | |
Base.pairs(nt) | |
BSImpl.AddMul{VartypeT}(1, dict, SymbolicUtils.AddMulVariant.MUL; type, | |
shape = SymbolicUtils.ShapeVecT(), unsafe = true) | |
*(y, z) | |
*(z, y) | |
SymbolicUtils.symtype(y) | |
f(x) | |
(5x / 5) | |
expand((x + y) ^ 2) | |
simplify(x ^ (1//2) + (sin(x) ^ 2 + cos(x) ^ 2) + 2(x + y) - x - y) | |
ex = x + 2y + sin(x) | |
rules1 = Dict(x => y) | |
rules2 = Dict(x => 1) | |
Dx = Differential(x) | |
Differential(y)(ex) | |
uex = unwrap(ex) | |
Symbolics.executediff(Dx, uex) | |
# Running `fold = Val(true)` invalidates the precompiled statements | |
# for `fold = Val(false)` and itself doesn't precompile anyway. | |
# substitute(ex, rules1) | |
substitute(ex, rules1; fold = fold1) | |
substitute(ex, rules2; fold = fold1) | |
@variables foo | |
f(foo) | |
@variables x y f(::Real) q[1:5] | |
x + y | |
x * y | |
x / y | |
x ^ y | |
x ^ 5 | |
# 6 ^ x | |
x - y | |
-y | |
2y | |
symtype(y) | |
z = 2 | |
*(y, z) | |
*(z, y) | |
f(x) | |
(5x / 5) | |
[x, y] | |
[x, f, f] | |
promote_type(Int, Num) | |
promote_type(Real, Num) | |
promote_type(Float64, Num) | |
# expand((x + y) ^ 2) | |
# simplify(x ^ (1//2) + (sin(x) ^ 2 + cos(x) ^ 2) + 2(x + y) - x - y) | |
ex = x + 2y + sin(x) | |
rules1 = Dict(x => y) | |
# rules2 = Dict(x => 1) | |
# Running `fold = Val(true)` invalidates the precompiled statements | |
# for `fold = Val(false)` and itself doesn't precompile anyway. | |
# substitute(ex, rules1) | |
substitute(ex, rules1; fold = fold1) | |
Symbolics.linear_expansion(ex, y) | |
# substitute(ex, rules2; fold = fold1) | |
# substitute(ex, rules2) | |
# substitute(ex, rules1; fold = fold2) | |
# substitute(ex, rules2; fold = fold2) | |
q[1] | |
q'q | |
using ModelingToolkit |
@named sys = System([ModelingToolkit.D_nounits(x) ~ -x], ModelingToolkit.t_nounits) | ||
prob = ODEProblem(mtkcompile(sys), [x => 30.0], (0, 100), jac = true) | ||
isequal(ModelingToolkit.D_nounits.x, ModelingToolkit.t_nounits) | ||
sys = System([ModelingToolkit.D_nounits(x) ~ x], ModelingToolkit.t_nounits, [x], Num[]; name = :sys) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
sys = System([ModelingToolkit.D_nounits(x) ~ x], ModelingToolkit.t_nounits, [x], Num[]; name = :sys) | |
sys = System([ModelingToolkit.D_nounits(x) ~ x], | |
ModelingToolkit.t_nounits, [x], Num[]; name = :sys) |
precompile(Tuple{typeof(Base.merge), NamedTuple{(:f, :args, :metadata, :hash, :hash2, :shape, :type, :id), Tuple{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, SymbolicUtils.SmallVec{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, Array{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, 1}}, Nothing, UInt64, UInt64, SymbolicUtils.SmallVec{Base.UnitRange{Int64}, Array{Base.UnitRange{Int64}, 1}}, DataType, SymbolicUtils.IDType}}, NamedTuple{(:metadata,), Tuple{Base.ImmutableDict{DataType, Any}}}}) | ||
precompile(Tuple{typeof(Base.merge), NamedTuple{(:f, :args, :metadata, :hash, :hash2, :shape, :type, :id), Tuple{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, SymbolicUtils.SmallVec{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, Array{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, 1}}, Base.ImmutableDict{DataType, Any}, UInt64, UInt64, SymbolicUtils.SmallVec{Base.UnitRange{Int64}, Array{Base.UnitRange{Int64}, 1}}, DataType, SymbolicUtils.IDType}}, NamedTuple{(:id, :hash, :hash2), Tuple{Nothing, Int64, Int64}}}) | ||
precompile(Tuple{typeof(Core.kwcall), NamedTuple{(:f, :args, :metadata, :hash, :hash2, :shape, :type, :id), Tuple{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, SymbolicUtils.SmallVec{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, Array{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, 1}}, Base.ImmutableDict{DataType, Any}, Int64, Int64, SymbolicUtils.SmallVec{Base.UnitRange{Int64}, Array{Base.UnitRange{Int64}, 1}}, DataType, Nothing}}, Type{SymbolicUtils.BasicSymbolicImpl.Term{SymbolicUtils.SymReal}}}) | ||
precompile(Tuple{typeof(Symbolics.parse_vars), Symbol, Type, Tuple{Symbol, Symbol}, Function}) | ||
precompile(Tuple{typeof(Base.merge), NamedTuple{(:name, :metadata, :hash, :hash2, :shape, :type, :id), Tuple{Symbol, Base.ImmutableDict{DataType, Any}, UInt64, UInt64, SymbolicUtils.SmallVec{Base.UnitRange{Int64}, Array{Base.UnitRange{Int64}, 1}}, DataType, SymbolicUtils.IDType}}, NamedTuple{(:metadata,), Tuple{Base.ImmutableDict{DataType, Any}}}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
precompile(Tuple{typeof(Base.merge), NamedTuple{(:f, :args, :metadata, :hash, :hash2, :shape, :type, :id), Tuple{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, SymbolicUtils.SmallVec{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, Array{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, 1}}, Nothing, UInt64, UInt64, SymbolicUtils.SmallVec{Base.UnitRange{Int64}, Array{Base.UnitRange{Int64}, 1}}, DataType, SymbolicUtils.IDType}}, NamedTuple{(:metadata,), Tuple{Base.ImmutableDict{DataType, Any}}}}) | |
precompile(Tuple{typeof(Base.merge), NamedTuple{(:f, :args, :metadata, :hash, :hash2, :shape, :type, :id), Tuple{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, SymbolicUtils.SmallVec{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, Array{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, 1}}, Base.ImmutableDict{DataType, Any}, UInt64, UInt64, SymbolicUtils.SmallVec{Base.UnitRange{Int64}, Array{Base.UnitRange{Int64}, 1}}, DataType, SymbolicUtils.IDType}}, NamedTuple{(:id, :hash, :hash2), Tuple{Nothing, Int64, Int64}}}) | |
precompile(Tuple{typeof(Core.kwcall), NamedTuple{(:f, :args, :metadata, :hash, :hash2, :shape, :type, :id), Tuple{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, SymbolicUtils.SmallVec{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, Array{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, 1}}, Base.ImmutableDict{DataType, Any}, Int64, Int64, SymbolicUtils.SmallVec{Base.UnitRange{Int64}, Array{Base.UnitRange{Int64}, 1}}, DataType, Nothing}}, Type{SymbolicUtils.BasicSymbolicImpl.Term{SymbolicUtils.SymReal}}}) | |
precompile(Tuple{typeof(Symbolics.parse_vars), Symbol, Type, Tuple{Symbol, Symbol}, Function}) | |
precompile(Tuple{typeof(Base.merge), NamedTuple{(:name, :metadata, :hash, :hash2, :shape, :type, :id), Tuple{Symbol, Base.ImmutableDict{DataType, Any}, UInt64, UInt64, SymbolicUtils.SmallVec{Base.UnitRange{Int64}, Array{Base.UnitRange{Int64}, 1}}, DataType, SymbolicUtils.IDType}}, NamedTuple{(:metadata,), Tuple{Base.ImmutableDict{DataType, Any}}}}) | |
precompile(Tuple{typeof(Base.merge), | |
NamedTuple{(:f, :args, :metadata, :hash, :hash2, :shape, :type, :id), | |
Tuple{ | |
SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, | |
SymbolicUtils.SmallVec{ | |
SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, | |
Array{ | |
SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, | |
1}}, | |
Nothing, | |
UInt64, | |
UInt64, | |
SymbolicUtils.SmallVec{Base.UnitRange{Int64}, Array{Base.UnitRange{Int64}, 1}}, | |
DataType, | |
SymbolicUtils.IDType}}, | |
NamedTuple{(:metadata,), Tuple{Base.ImmutableDict{DataType, Any}}}}) | |
precompile(Tuple{typeof(Base.merge), | |
NamedTuple{(:f, :args, :metadata, :hash, :hash2, :shape, :type, :id), | |
Tuple{ | |
SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, | |
SymbolicUtils.SmallVec{ | |
SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, | |
Array{ | |
SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, | |
1}}, | |
Base.ImmutableDict{DataType, Any}, | |
UInt64, | |
UInt64, | |
SymbolicUtils.SmallVec{Base.UnitRange{Int64}, Array{Base.UnitRange{Int64}, 1}}, | |
DataType, | |
SymbolicUtils.IDType}}, | |
NamedTuple{(:id, :hash, :hash2), Tuple{Nothing, Int64, Int64}}}) | |
precompile(Tuple{typeof(Core.kwcall), | |
NamedTuple{(:f, :args, :metadata, :hash, :hash2, :shape, :type, :id), | |
Tuple{ | |
SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, | |
SymbolicUtils.SmallVec{ | |
SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, | |
Array{ | |
SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, | |
1}}, | |
Base.ImmutableDict{DataType, Any}, | |
Int64, | |
Int64, | |
SymbolicUtils.SmallVec{Base.UnitRange{Int64}, Array{Base.UnitRange{Int64}, 1}}, | |
DataType, | |
Nothing}}, | |
Type{SymbolicUtils.BasicSymbolicImpl.Term{SymbolicUtils.SymReal}}}) | |
precompile(Tuple{ | |
typeof(Symbolics.parse_vars), Symbol, Type, Tuple{Symbol, Symbol}, Function}) | |
precompile(Tuple{typeof(Base.merge), | |
NamedTuple{(:name, :metadata, :hash, :hash2, :shape, :type, :id), | |
Tuple{Symbol, Base.ImmutableDict{DataType, Any}, UInt64, UInt64, | |
SymbolicUtils.SmallVec{Base.UnitRange{Int64}, Array{Base.UnitRange{Int64}, 1}}, | |
DataType, SymbolicUtils.IDType}}, | |
NamedTuple{(:metadata,), Tuple{Base.ImmutableDict{DataType, Any}}}}) |
precompile(Tuple{typeof(Core.kwcall), NamedTuple{(:name, :defaults), Tuple{Symbol, Base.Dict{Symbolics.Num, Float64}}}, Type{ModelingToolkit.System}, Array{Symbolics.Equation, 1}, Symbolics.Num, Array{Symbolics.Num, 1}, Array{Symbolics.Num, 1}}) | ||
precompile(Tuple{Type{NamedTuple{(:name, :defaults), T} where T<:Tuple}, Tuple{Symbol, Base.Dict{Symbolics.Num, Float64}}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
precompile(Tuple{typeof(Core.kwcall), NamedTuple{(:name, :defaults), Tuple{Symbol, Base.Dict{Symbolics.Num, Float64}}}, Type{ModelingToolkit.System}, Array{Symbolics.Equation, 1}, Symbolics.Num, Array{Symbolics.Num, 1}, Array{Symbolics.Num, 1}}) | |
precompile(Tuple{Type{NamedTuple{(:name, :defaults), T} where T<:Tuple}, Tuple{Symbol, Base.Dict{Symbolics.Num, Float64}}}) | |
precompile(Tuple{typeof(Core.kwcall), | |
NamedTuple{(:name, :defaults), Tuple{Symbol, Base.Dict{Symbolics.Num, Float64}}}, | |
Type{ModelingToolkit.System}, Array{Symbolics.Equation, 1}, | |
Symbolics.Num, Array{Symbolics.Num, 1}, Array{Symbolics.Num, 1}}) | |
precompile(Tuple{Type{NamedTuple{(:name, :defaults), T} where T <: Tuple}, | |
Tuple{Symbol, Base.Dict{Symbolics.Num, Float64}}}) |
precompile(Tuple{Type{NamedTuple{(:name, :defaults, :guesses), T} where T<:Tuple}, Tuple{Symbol, Base.Dict{Symbolics.Num, Float64}, Base.Dict{Symbolics.Num, Float64}}}) | ||
precompile(Tuple{typeof(Core.kwcall), NamedTuple{(:name, :defaults, :guesses), Tuple{Symbol, Base.Dict{Symbolics.Num, Float64}, Base.Dict{Symbolics.Num, Float64}}}, Type{ModelingToolkit.System}, Array{Symbolics.Equation, 1}, Symbolics.Num, Array{Symbolics.Num, 1}, Array{Symbolics.Num, 1}}) | ||
precompile(Tuple{typeof(Core.kwcall), NamedTuple{(:type, :shape), Tuple{DataType, SymbolicUtils.SmallVec{Base.UnitRange{Int64}, Array{Base.UnitRange{Int64}, 1}}}}, typeof(SymbolicUtils.term), Any, SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
precompile(Tuple{Type{NamedTuple{(:name, :defaults, :guesses), T} where T<:Tuple}, Tuple{Symbol, Base.Dict{Symbolics.Num, Float64}, Base.Dict{Symbolics.Num, Float64}}}) | |
precompile(Tuple{typeof(Core.kwcall), NamedTuple{(:name, :defaults, :guesses), Tuple{Symbol, Base.Dict{Symbolics.Num, Float64}, Base.Dict{Symbolics.Num, Float64}}}, Type{ModelingToolkit.System}, Array{Symbolics.Equation, 1}, Symbolics.Num, Array{Symbolics.Num, 1}, Array{Symbolics.Num, 1}}) | |
precompile(Tuple{typeof(Core.kwcall), NamedTuple{(:type, :shape), Tuple{DataType, SymbolicUtils.SmallVec{Base.UnitRange{Int64}, Array{Base.UnitRange{Int64}, 1}}}}, typeof(SymbolicUtils.term), Any, SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}}) | |
precompile(Tuple{Type{NamedTuple{(:name, :defaults, :guesses), T} where T <: Tuple}, | |
Tuple{Symbol, Base.Dict{Symbolics.Num, Float64}, Base.Dict{Symbolics.Num, Float64}}}) | |
precompile(Tuple{typeof(Core.kwcall), | |
NamedTuple{(:name, :defaults, :guesses), | |
Tuple{Symbol, Base.Dict{Symbolics.Num, Float64}, Base.Dict{Symbolics.Num, Float64}}}, | |
Type{ModelingToolkit.System}, | |
Array{Symbolics.Equation, 1}, | |
Symbolics.Num, | |
Array{Symbolics.Num, 1}, | |
Array{Symbolics.Num, 1}}) | |
precompile(Tuple{typeof(Core.kwcall), | |
NamedTuple{(:type, :shape), | |
Tuple{DataType, | |
SymbolicUtils.SmallVec{Base.UnitRange{Int64}, Array{Base.UnitRange{Int64}, 1}}}}, | |
typeof(SymbolicUtils.term), | |
Any, | |
SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}}) |
term = namespace_expr(term, sys, n; ivs) | ||
end | ||
expr = namespace_expr(expr, sys, n; ivs) | ||
return BSImpl.ArrayOp{VartypeT}(output_idx, expr, reduce, term, ranges; type, shape, metadata) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
return BSImpl.ArrayOp{VartypeT}(output_idx, expr, reduce, term, ranges; type, shape, metadata) | |
return BSImpl.ArrayOp{VartypeT}( | |
output_idx, expr, reduce, term, ranges; type, shape, metadata) |
for (i, eq) in enumerate(eqs) | ||
empty!(varsbuf) | ||
vars!(varsbuf, eq; op = Union{Differential, Initial, Pre}) | ||
SU.search_variables!(varsbuf, eq; is_atomic = OperatorIsAtomic{Union{Differential, Initial, Pre}}()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
SU.search_variables!(varsbuf, eq; is_atomic = OperatorIsAtomic{Union{Differential, Initial, Pre}}()) | |
SU.search_variables!(varsbuf, eq; is_atomic = OperatorIsAtomic{Union{ | |
Differential, Initial, Pre}}()) |
end | ||
|
||
function observed2graph(eqs, unknowns) | ||
function observed2graph(eqs::Vector{Equation}, unknowns::Vector{SymbolicT})::Tuple{BipartiteGraph{Int, Nothing}, Vector{Int}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
function observed2graph(eqs::Vector{Equation}, unknowns::Vector{SymbolicT})::Tuple{BipartiteGraph{Int, Nothing}, Vector{Int}} | |
function observed2graph(eqs::Vector{Equation}, | |
unknowns::Vector{SymbolicT})::Tuple{BipartiteGraph{Int, Nothing}, Vector{Int}} |
@set! sys.unknowns = s(get_unknowns(sys)) | ||
@set! sys.ps = s(get_ps(sys)) | ||
AffectSystem(sys, s(aff.unknowns), s(aff.parameters), s(aff.discretes)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
""" | ||
const DDE_HISTORY_FUN = Sym{Symbolics.FnType{Tuple{Any, <:Real}, Vector{Real}}}(:___history___) | ||
const BVP_SOLUTION = Sym{Symbolics.FnType{Tuple{<:Real}, Vector{Real}}}(:__sol__) | ||
const DDE_HISTORY_FUN = SSym(:___history___; type = SU.FnType{Tuple{Any, <:Real}, Vector{Real}}, shape = SU.Unknown(1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
const DDE_HISTORY_FUN = SSym(:___history___; type = SU.FnType{Tuple{Any, <:Real}, Vector{Real}}, shape = SU.Unknown(1)) | |
const DDE_HISTORY_FUN = SSym( | |
:___history___; type = SU.FnType{Tuple{Any, <:Real}, Vector{Real}}, shape = SU.Unknown(1)) |
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Add any other context about the problem here.