-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setu
does not perform any sizecheck
#82
Labels
bug
Something isn't working
Comments
I think this could be solved by replacing SymbolicIndexingInterface.jl/src/parameter_indexing.jl Lines 206 to 208 in c9c7b6c
Underlying issue being that mapping over multiple collections only loops through the shortest list. I think broadcast behaviour is what you'd expect here julia> map((a,b)->a*repr(b), ["foo", "bar"], 1)
1-element Vector{String}:
"foo1"
julia> map((a,b)->a*repr(b), ["foo", "bar"], [1,2])
2-element Vector{String}:
"foo1"
"bar2"
julia> map((a,b)->a*repr(b), ["foo", "bar"], [1,2,3])
2-element Vector{String}:
"foo1"
"bar2"
julia> broadcast((a,b)->a*repr(b), ["foo", "bar"], 1)
2-element Vector{String}:
"foo1"
"bar1"
julia> broadcast((a,b)->a*repr(b), ["foo", "bar"], [1,2])
2-element Vector{String}:
"foo1"
"bar2"
julia> broadcast((a,b)->a*repr(b), ["foo", "bar"], [1,2,3])
ERROR: DimensionMismatch: arrays could not be broadcast to a common size: a has axes Base.OneTo(2) and b has axes |
hexaeder
added a commit
to hexaeder/SymbolicIndexingInterface.jl
that referenced
this issue
Jun 3, 2024
hexaeder
added a commit
to hexaeder/SymbolicIndexingInterface.jl
that referenced
this issue
Jun 3, 2024
5 tasks
hexaeder
added a commit
to hexaeder/SymbolicIndexingInterface.jl
that referenced
this issue
Jun 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug 🐞
setu
does not perform sizecheck between the new values and the number of indexed elements.Expected behavior
I would expect it to either error or implicitly broadcast, but it only overwrites a single value. The expectation comes especially when using the
setindex!
interface, because then it feels like array indexingMinimal Reproducible Example 👇
The text was updated successfully, but these errors were encountered: