Skip to content

Commit b936231

Browse files
fix: do not alias variables, return nothing from set_parameter!
1 parent 50a4b12 commit b936231

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/systems/parameter_buffer.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,8 @@ function SymbolicIndexingInterface.parameter_values(p::MTKParameters, pind::Para
384384
end
385385

386386
function SymbolicIndexingInterface.set_parameter!(
387-
p::MTKParameters, val, idx::ParameterIndex)
388-
@unpack portion, idx, validate_size = idx
387+
p::MTKParameters, val, pidx::ParameterIndex)
388+
@unpack portion, idx, validate_size = pidx
389389
if portion isa SciMLStructures.Tunable
390390
if validate_size && size(val) !== size(idx)
391391
throw(InvalidParameterSizeException(size(idx), size(val)))
@@ -428,6 +428,7 @@ function SymbolicIndexingInterface.set_parameter!(
428428
if p.dependent_update_iip !== nothing
429429
p.dependent_update_iip(ArrayPartition(p.dependent), p...)
430430
end
431+
return nothing
431432
end
432433

433434
function _set_parameter_unchecked!(

0 commit comments

Comments
 (0)