@@ -304,8 +304,36 @@ a = Remake_Test1(p = 1)
304304@test @inferred remake (a, kwargs = (; a = 1 )) == Remake_Test1 (p = 1 , a = 1 )
305305
306306@testset " fill_u0 and fill_p ignore identical variables with different names" begin
307- sys = SymbolCache (Dict (:x => 1 , :x2 => 1 , :y => 2 ), Dict (:a => 1 , :a2 => 1 , :b => 2 ),
308- :t ; defaults = Dict (:x => 1 , :y => 2 , :a => 3 , :b => 4 ))
307+ struct SCWrapper{S}
308+ sc:: S
309+ end
310+ SymbolicIndexingInterface. symbolic_container (s:: SCWrapper ) = s. sc
311+ function SymbolicIndexingInterface. is_variable (s:: SCWrapper , i:: Symbol )
312+ if i == :x2
313+ return is_variable (s. sc, :x )
314+ end
315+ is_variable (s. sc, i)
316+ end
317+ function SymbolicIndexingInterface. variable_index (s:: SCWrapper , i:: Symbol )
318+ if i == :x2
319+ return variable_index (s. sc, :x )
320+ end
321+ variable_index (s. sc, i)
322+ end
323+ function SymbolicIndexingInterface. is_parameter (s:: SCWrapper , i:: Symbol )
324+ if i == :a2
325+ return is_parameter (s. sc, :a )
326+ end
327+ is_parameter (s. sc, i)
328+ end
329+ function SymbolicIndexingInterface. parameter_index (s:: SCWrapper , i:: Symbol )
330+ if i == :a2
331+ return parameter_index (s. sc, :a )
332+ end
333+ parameter_index (s. sc, i)
334+ end
335+ sys = SCWrapper (SymbolCache (Dict (:x => 1 , :y => 2 ), Dict (:a => 1 , :b => 2 ),
336+ :t ; defaults = Dict (:x => 1 , :y => 2 , :a => 3 , :b => 4 )))
309337 function foo (du, u, p, t)
310338 du .= u .* p
311339 end
@@ -323,7 +351,7 @@ a = Remake_Test1(p = 1)
323351end
324352
325353@testset " value of `nothing` is ignored" begin
326- sys = SymbolCache (Dict (:x => 1 , :x2 => 1 , : y => 2 ), Dict (:a => 1 , :a2 => 1 , :b => 2 ),
354+ sys = SymbolCache (Dict (:x => 1 , :y => 2 ), Dict (:a => 1 , :b => 2 ),
327355 :t ; defaults = Dict (:x => 1 , :y => 2 , :a => 3 , :b => 4 ))
328356 function foo (du, u, p, t)
329357 du .= u .* p
0 commit comments