ModelingToolkit.jl icon indicating copy to clipboard operation
ModelingToolkit.jl copied to clipboard

Add boundscheck to `setp`/`setu`

Open ggkountouras opened this issue 6 months ago • 0 comments

Is your feature request related to a problem? Please describe.

Calling a setter! created with setter! = setp(sys, [sys.my_param]) doesn't ensure that the length of the array/tuple passed to the functor is the same as the number of symbolic parameters passed to setp/setu.

Describe the solution you’d like

setter! should have a boundscheck.

Additional context

If there is runtime overhead to the check, add the option to disable it for compiled code.

ggkountouras avatar Aug 28 '24 11:08 ggkountouras