SciML / SymbolicIndexingInterface.jl

A general interface for symbolic indexing of SciML objects used in conjunction with Domain-Specific Languages
https://docs.sciml.ai/SymbolicIndexingInterface/stable/
MIT License
15 stars 8 forks source link

check dimensions for multiple setters #83

Open hexaeder opened 4 months ago

hexaeder commented 4 months ago

Checklist

Additional context

fixes #82

Technically breaking? But I personally would consider the old behaviour a bug.

hexaeder commented 4 months ago

Instead of changing from map to broadcast, it would also be fine to check the sizes explicitly

if size(ms.setters) != size(val)
    throw(DimensionMismatch("Cannot set variables of size $(size(ms.setters)) to values of size $(size(val))."))
end

My point about the bug is the silent dropping of setters/values rather than the missing broadcast behavior.