Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork234
[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 ourterms of service andprivacy 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 byreviewdog 🐶
ModelingToolkit.jl/src/systems/connectors.jl
Line 1118 inbf11961
| SymbolicUtils.promote_symtype(::typeof(instream_rt),::Type{T},::Type{S},::Type{R})where {T, S, R}= Real |
[JuliaFormatter]reported byreviewdog 🐶
[JuliaFormatter]reported byreviewdog 🐶
| const MaybeArrayIndexT= Union{Int, UnitRange{Int}, Base.ReshapedArray{Int, N, UnitRange{Int}}where {N}} |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/systems/index_cache.jl
Lines 114 to 115 inbf11961
| 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 byreviewdog 🐶
| push!(disc_syms_by_symtype_by_partition[i],filter(==(partition)∘ Base.Fix1(getindex, disc_param_callbacks), buffer)) |
[JuliaFormatter]reported byreviewdog 🐶
| push!(disc_buffer_templates,map(Base.Fix1(BufferTemplate, symtype)∘ length, disc_syms_by_partition)) |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/systems/index_cache.jl
Lines 298 to 301 inbf11961
| BSImpl.Term(; f, args)=>begin | |
| f=== getindex&& (idx=get(disc_idxs, args[1],nothing))!==nothing | |
| end | |
| _=>false |
[JuliaFormatter]reported byreviewdog 🐶
| functionparse_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 byreviewdog 🐶
| function SymbolicIndexingInterface.parameter_index(ic::IndexCache, sym::Union{Num, Symbolics.Arr, Symbolics.CallAndWrap}) |
[JuliaFormatter]reported byreviewdog 🐶
| functioncheck_index_map(idxmap::Dict{SymbolicT, V}, sym::SymbolicT)::Union{V, Nothing}where {V} |
[JuliaFormatter]reported byreviewdog 🐶
| mask[i]=!iscall(eq.rhs)||operation(eq.rhs)!== StructuralTransformations.change_origin |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/systems/system.jl
Line 282 inbf11961
| if (checksisa Bool&& checks===true|| checksisa Int&& (checks& CheckComponents)>0)&& iv!==nothing |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/systems/system.jl
Line 448 inbf11961
[JuliaFormatter]reported byreviewdog 🐶
| fullvars[i], discmap; filterer= Symbolics.FPSubFilterer{Union{Sample, Hold, Pre}}())) |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 36 inbf11961
| issym(op)&&returnSSym(nameof(op); type= FnType{Tuple{symtype(iv)}, Real}, shape= SU.ShapeVecT())(iv) |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 193 inbf11961
| BSImpl.Term(; f)&&if fisa Differentialend=>begin |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 288 inbf11961
| functionprocess_variables!(var_to_name::Dict{Symbol, SymbolicT}, defs::SymmapT, guesses::SymmapT, vars::Vector{SymbolicT}) |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 328 inbf11961
| BSImpl.Term(; f, args)&&if f=== getindexend=> args[1] |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 399 inbf11961
| hasmetadata(x, VariableSource)||iscall(x)&&operation(x)=== getindex&&isvariable(arguments(x)[1])::Bool |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 543 inbf11961
| functioncollect_scoped_vars!(unknowns::OrderedSet{SymbolicT}, parameters::OrderedSet{SymbolicT}, sys::AbstractSystem, iv::Union{SymbolicT, Nothing}; depth=1, op= Differential) |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 626 inbf11961
| BSImpl.Term(; f)&&if fisa Oend=>true |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 635 inbf11961
| BSImpl.Term(; f)&&if fisa Operatorend=> fisa O |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 654 inbf11961
| functioncollect_vars!(unknowns::OrderedSet{SymbolicT}, parameters::OrderedSet{SymbolicT}, expr::SymbolicT, iv::Union{SymbolicT, Nothing}; depth=0, op= Symbolics.Operator) |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 672 inbf11961
| functioncollect_vars!(unknowns::OrderedSet{SymbolicT}, parameters::OrderedSet{SymbolicT}, expr::AbstractArray{SymbolicT}, iv::Union{SymbolicT, Nothing}; depth=0, op= Symbolics.Operator) |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/utils.jl
Line 724 inbf11961
| check_scope_depth(getmetadata(var, SymScope,LocalScope())::AllScopes, depth)||returnnothing |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/variables.jl
Line 198 inbf11961
| iscall(x)&&operation(x)=== getindex&&returnsafe_getmetadata(m,arguments(x)[1], default) |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/variables.jl
Line 259 inbf11961
| BSImpl.Term(; f, args, shape, type, metadata)&&if fisa Operatorend=>begin |
[JuliaFormatter]reported byreviewdog 🐶
ModelingToolkit.jl/src/variables.jl
Line 621 inbf11961
| getunshifted(x::SymbolicT)= Symbolics.getmetadata(x, VariableUnshifted,nothing)::Union{SymbolicT, Nothing} |
| fold1=Val{false}() | ||
| using SymbolicUtils | ||
| using SymbolicUtils: shape | ||
| using Symbolics | ||
| @syms x yf(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 yf(::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 byreviewdog 🐶
| fold1=Val{false}() | |
| using SymbolicUtils | |
| using SymbolicUtils: shape | |
| using Symbolics | |
| @syms x yf(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 yf(::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 yf(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 yf(::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 |
src/ModelingToolkit.jl Outdated
| @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 byreviewdog 🐶
| 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 byreviewdog 🐶
| 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 byreviewdog 🐶
| 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 byreviewdog 🐶
| 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 byreviewdog 🐶
| 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)inenumerate(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 byreviewdog 🐶
| 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 | ||
| functionobserved2graph(eqs, unknowns) | ||
| functionobserved2graph(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 byreviewdog 🐶
| functionobserved2graph(eqs::Vector{Equation}, unknowns::Vector{SymbolicT})::Tuple{BipartiteGraph{Int, Nothing}, Vector{Int}} | |
| functionobserved2graph(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 byreviewdog 🐶
| """ | ||
| 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 byreviewdog 🐶
| 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)) |
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.
How are you now supporting a list of variables from which any collected variables must be members? That seems dropped in this new version of these functions.
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.
Symbolics.get_variables does this, and is a wrapper overSymbolicUtils.search_variables! with the appropriate filter function. Now this is a common API forany sort of filter you might want to apply to the collected variables.
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.
So that is whatis_atomic does? (Just because from the name is unclear to me what it means.)
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.
Yes. I'm working on improving docs in SymbolicUtils for all of the new stuff.is_atomic takes an expression and returns a boolean identifying whether the expression should be considered "atomic" and included in the list of variables. The function should probably be namedfind_atomics but now that requires amassive find-and-replace.
AayushSabharwalOct 14, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
This isn't to say Iwon't do the renaming, but rather that I might wait a bit to get things working first.
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.
Sounds good! I just wanted to check the filtering wasn’t being inadvertently lost for MassActionJump stoichiometric species.
Checklist
contributor guidelines, in particular theSciML Style Guide and
COLPRAC.
Additional context
Add any other context about the problem here.