Skip to content

Commit 13c01d5

Browse files
authored
Merge branch 'master' into moshi
2 parents f01c386 + a454760 commit 13c01d5

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SciMLBase"
22
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
33
authors = ["Chris Rackauckas <[email protected]> and contributors"]
4-
version = "2.72.0"
4+
version = "2.72.1"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

src/remake.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,10 @@ function fill_vars(
910910
v === nothing && continue
911911
idx = index_function(prob, k)
912912
idx === nothing && continue
913-
if !(idx isa AbstractArray) || symbolic_type(k) != ArraySymbolic()
913+
# If `k` is an array symbolic, and `[:k => [1.0, 2.0]]` is provided
914+
if idx isa AbstractArray && symbolic_type(k) == ScalarSymbolic()
915+
k = [idx_to_vsym[i] for i in idx]
916+
elseif !(idx isa AbstractArray) || symbolic_type(k) != ArraySymbolic()
914917
idx = (idx,)
915918
k = (k,)
916919
v = (v,)

test/downstream/modelingtoolkit_remake.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,3 +424,11 @@ end
424424
@test eltype(initprob.u0) <: ForwardDiff.Dual
425425
@test eltype(SciMLStructures.canonicalize(SciMLStructures.Tunable(), initprob.p)[1]) <: ForwardDiff.Dual
426426
end
427+
428+
@testset "Array unknown specified as Symbol" begin
429+
@variables x(t)[1:2]
430+
@parameters k
431+
@mtkbuild sys = ODESystem([D(x[1]) ~ k * x[1], D(x[2]) ~ - x[2]], t)
432+
prob = ODEProblem(sys, [x => ones(2)], (0.0, 1.0), [k => 2.0])
433+
prob2 = remake(prob; u0 = [:x => 2ones(2)])
434+
end

0 commit comments

Comments
 (0)