Skip to content

Commit 0baecb2

Browse files
format
1 parent 4ca31a8 commit 0baecb2

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/variables.jl

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ end
108108
throw(ArgumentError("$vars are missing from the variable map."))
109109
end
110110

111+
# FIXME: remove after: https://github.com/SciML/SciMLBase.jl/pull/311
112+
function SciMLBase.handle_varmap(varmap, sys::AbstractSystem; field = :states, kwargs...)
113+
out = varmap_to_vars(varmap, getfield(sys, field); kwargs...)
114+
return out
115+
end
116+
111117
"""
112118
$(SIGNATURES)
113119
@@ -117,12 +123,14 @@ user has `ModelingToolkit` loaded.
117123
function SciMLBase.process_p_u0_symbolic(prob::ODEProblem, p, u0)
118124
# check if a symbolic remake is possible
119125
if eltype(p) <: Pair
120-
hasproperty(prob.f, :sys) && hasfield(typeof(prob.f.sys), :ps) || throw(ArgumentError("This problem does not support symbolic maps with `remake`, i.e. it does not have a symbolic origin." *
121-
" Please use `remake` with the `p` keyword argument as a vector of values, paying attention to parameter order."))
126+
hasproperty(prob.f, :sys) && hasfield(typeof(prob.f.sys), :ps) ||
127+
throw(ArgumentError("This problem does not support symbolic maps with `remake`, i.e. it does not have a symbolic origin." *
128+
" Please use `remake` with the `p` keyword argument as a vector of values, paying attention to parameter order."))
122129
end
123130
if eltype(u0) <: Pair
124-
hasproperty(prob.f, :sys) && hasfield(typeof(prob.f.sys), :states) || throw(ArgumentError("This problem does not support symbolic maps with `remake`, i.e. it does not have a symbolic origin." *
125-
" Please use `remake` with the `u0` keyword argument as a vector of values, paying attention to state order."))
131+
hasproperty(prob.f, :sys) && hasfield(typeof(prob.f.sys), :states) ||
132+
throw(ArgumentError("This problem does not support symbolic maps with `remake`, i.e. it does not have a symbolic origin." *
133+
" Please use `remake` with the `u0` keyword argument as a vector of values, paying attention to state order."))
126134
end
127135

128136
# assemble defaults

0 commit comments

Comments
 (0)