@@ -506,15 +506,38 @@ function SymbolicIndexingInterface.remake_buffer(indp, oldbuf::MTKParameters, va
506
506
@set! newbuf. nonnumeric = Tuple (Vector {Any} (undef, length (buf))
507
507
for buf in newbuf. nonnumeric)
508
508
509
+ syms = collect (keys (vals))
510
+ vals = Dict {Any, Any} (vals)
511
+ for sym in syms
512
+ symbolic_type (sym) == ArraySymbolic () || continue
513
+ is_parameter (indp, sym) && continue
514
+ stype = symtype (unwrap (sym))
515
+ stype <: AbstractArray || continue
516
+ Symbolics. shape (sym) == Symbolics. Unknown () && continue
517
+ for i in eachindex (sym)
518
+ vals[sym[i]] = vals[sym][i]
519
+ end
520
+ end
521
+
509
522
# If the parameter buffer is an `MTKParameters` object, `indp` must eventually drill
510
523
# down to an `AbstractSystem` using `symbolic_container`. We leverage this to get
511
524
# the index cache.
512
525
ic = get_index_cache (indp_to_system (indp))
513
526
for (p, val) in vals
514
527
idx = parameter_index (indp, p)
515
- validate_parameter_type (ic, p, idx, val)
516
- _set_parameter_unchecked! (
517
- newbuf, val, idx; update_dependent = false )
528
+ if idx != = nothing
529
+ validate_parameter_type (ic, p, idx, val)
530
+ _set_parameter_unchecked! (
531
+ newbuf, val, idx; update_dependent = false )
532
+ elseif symbolic_type (p) == ArraySymbolic ()
533
+ for (i, j) in zip (eachindex (p), eachindex (val))
534
+ pi = p[i]
535
+ idx = parameter_index (indp, pi )
536
+ validate_parameter_type (ic, pi , idx, val[j])
537
+ _set_parameter_unchecked! (
538
+ newbuf, val[j], idx; update_dependent = false )
539
+ end
540
+ end
518
541
end
519
542
520
543
@set! newbuf. tunable = narrow_buffer_type_and_fallback_undefs .(
0 commit comments