Skip to content

Commit 5cae853

Browse files
feat: add new all-symbols methods from SII
1 parent f61f83f commit 5cae853

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ SimpleNonlinearSolve = "0.1.0, 1"
9898
SparseArrays = "1"
9999
SpecialFunctions = "0.7, 0.8, 0.9, 0.10, 1.0, 2"
100100
StaticArrays = "0.10, 0.11, 0.12, 1.0"
101-
SymbolicIndexingInterface = "0.3"
101+
SymbolicIndexingInterface = "0.3.1"
102102
SymbolicUtils = "1.0"
103103
Symbolics = "5.7"
104104
URIs = "1"

src/systems/abstractsystem.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,20 @@ SymbolicIndexingInterface.is_time_dependent(::AbstractTimeIndependentSystem) = f
286286

287287
SymbolicIndexingInterface.constant_structure(::AbstractSystem) = true
288288

289+
function SymbolicIndexingInterface.all_variable_symbols(sys::AbstractSystem)
290+
syms = variable_symbols(sys)
291+
obs = getproperty.(observed(sys), :lhs)
292+
return isempty(obs) ? syms : vcat(syms, obs)
293+
end
294+
295+
function SymbolicIndexingInterface.all_symbols(sys::AbstractSystem)
296+
syms = all_variable_symbols(sys)
297+
for other in (parameter_symbols(sys), independent_variable_symbols(sys))
298+
isempty(other) || (syms = vcat(syms, other))
299+
end
300+
return syms
301+
end
302+
289303
iscomplete(sys::AbstractSystem) = isdefined(sys, :complete) && getfield(sys, :complete)
290304

291305
"""

0 commit comments

Comments
 (0)