-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcorrectness bug ⚠Bugs that are likely to lead to incorrect results in user code without throwingBugs that are likely to lead to incorrect results in user code without throwingsearch & findThe find* family of functionsThe find* family of functions
Description
Index can be zero if you're using OffsetArrays.jl or similar. Also
affects findmax
, argmin
, argmax
.
If dims
is omitted or :
then you don't get this bug :)
Found while working on #35316 and I'll fix it there edit: I might fix it later, PR already too big.
Reproducible example:
julia> using OffsetArrays
julia> ov = OffsetVector([-1, 1], 0:1)
2-element OffsetArray(::Vector{Int64}, 0:1) with eltype Int64 with indices 0:1:
-1
1
julia> findmin(ov, dims=1) # Should be ([-1], [0])
([1], [1])
Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcorrectness bug ⚠Bugs that are likely to lead to incorrect results in user code without throwingBugs that are likely to lead to incorrect results in user code without throwingsearch & findThe find* family of functionsThe find* family of functions