diff --git a/src/systems/abstractsystem.jl b/src/systems/abstractsystem.jl index 0cc9811b07..ac865e41f2 100644 --- a/src/systems/abstractsystem.jl +++ b/src/systems/abstractsystem.jl @@ -187,11 +187,14 @@ function SymbolicIndexingInterface.is_variable(sys::AbstractSystem, sym) if unwrap(sym) isa Int # [x, 1] coerces 1 to a Num return unwrap(sym) in 1:length(unknown_states(sys)) end - return any(isequal(sym), unknown_states(sys)) || hasname(sym) && is_variable(sys, getname(sym)) + return any(isequal(sym), unknown_states(sys)) || + hasname(sym) && is_variable(sys, getname(sym)) end function SymbolicIndexingInterface.is_variable(sys::AbstractSystem, sym::Symbol) - return any(isequal(sym), getname.(unknown_states(sys))) || count('₊', string(sym)) == 1 && count(isequal(sym), Symbol.(sys.name, :₊, getname.(unknown_states(sys)))) == 1 + return any(isequal(sym), getname.(unknown_states(sys))) || + count('₊', string(sym)) == 1 && + count(isequal(sym), Symbol.(sys.name, :₊, getname.(unknown_states(sys)))) == 1 end function SymbolicIndexingInterface.variable_index(sys::AbstractSystem, sym) @@ -224,12 +227,14 @@ function SymbolicIndexingInterface.is_parameter(sys::AbstractSystem, sym) return unwrap(sym) in 1:length(parameters(sys)) end - return any(isequal(sym), parameters(sys)) || hasname(sym) && is_parameter(sys, getname(sym)) + return any(isequal(sym), parameters(sys)) || + hasname(sym) && is_parameter(sys, getname(sym)) end function SymbolicIndexingInterface.is_parameter(sys::AbstractSystem, sym::Symbol) return any(isequal(sym), getname.(parameters(sys))) || - count('₊', string(sym)) == 1 && count(isequal(sym), Symbol.(sys.name, :₊, getname.(parameters(sys)))) == 1 + count('₊', string(sym)) == 1 && + count(isequal(sym), Symbol.(sys.name, :₊, getname.(parameters(sys)))) == 1 end function SymbolicIndexingInterface.parameter_index(sys::AbstractSystem, sym) @@ -270,7 +275,8 @@ function SymbolicIndexingInterface.independent_variable_symbols(sys::AbstractSys end function SymbolicIndexingInterface.is_observed(sys::AbstractSystem, sym) - return !is_variable(sys, sym) && !is_parameter(sys, sym) && !is_independent_variable(sys, sym) && symbolic_type(sym) != NotSymbolic() + return !is_variable(sys, sym) && !is_parameter(sys, sym) && + !is_independent_variable(sys, sym) && symbolic_type(sym) != NotSymbolic() end SymbolicIndexingInterface.is_time_dependent(::AbstractTimeDependentSystem) = true diff --git a/src/systems/jumps/jumpsystem.jl b/src/systems/jumps/jumpsystem.jl index df50834903..9509582b1d 100644 --- a/src/systems/jumps/jumpsystem.jl +++ b/src/systems/jumps/jumpsystem.jl @@ -491,7 +491,7 @@ function (ratemap::JumpSysMajParamMapper{ U, V, W, - })(params) where {U <: AbstractArray, +})(params) where {U <: AbstractArray, V <: AbstractArray, W} updateparams!(ratemap, params) [convert(W, value(substitute(paramexpr, ratemap.subdict))) diff --git a/src/systems/nonlinear/initializesystem.jl b/src/systems/nonlinear/initializesystem.jl index c841566a0e..96119c8071 100644 --- a/src/systems/nonlinear/initializesystem.jl +++ b/src/systems/nonlinear/initializesystem.jl @@ -52,4 +52,4 @@ function initializesystem(sys::ODESystem; name = nameof(sys), kwargs...) kwargs...) return sys_nl -end \ No newline at end of file +end diff --git a/src/variables.jl b/src/variables.jl index ea4c425493..df359354a5 100644 --- a/src/variables.jl +++ b/src/variables.jl @@ -463,4 +463,4 @@ function get_default_or_guess(x) else return getguess(x) end -end \ No newline at end of file +end diff --git a/test/nonlinearsystem.jl b/test/nonlinearsystem.jl index 4de27977b0..0d1fcf90da 100644 --- a/test/nonlinearsystem.jl +++ b/test/nonlinearsystem.jl @@ -237,7 +237,7 @@ end @testset "Initialization System" begin # Define the Lotka Volterra system which begins at steady state @parameters t - pars = @parameters a=1.5 b=1.0 c=3.0 d=1.0 dx_ss = 1e-5 + pars = @parameters a=1.5 b=1.0 c=3.0 d=1.0 dx_ss=1e-5 vars = @variables begin dx(t), @@ -274,4 +274,4 @@ end # Confirm for all the states of the simplified system @test all(.≈(sol[states(sys_simple)], [1e-5 / 1.5, 0]; atol = 1e-8)) -end \ No newline at end of file +end