You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4|debug> st
In findindex(sel, range) at /Users/kristoffercarlsson/.julia/packages/AxisKeys/G3Okw/src/selectors.jl:66
66 function findindex(sel::Near, range::AbstractRange)
67 iplus = searchsortedfirst(range, sel.val)
68 # "index of the first value in a greater than or equal to x"
>69 if abs(range[iplus]-sel.val) < abs(range[iplus-1]-sel.val)
70 return iplus
71 else
72 return iplus-1
73 end
74 end
About to run: (getindex)(1.0:-0.1:0.1, 0)
4|julia> range
1.0:-0.1:0.1
4|julia> issorted(range)
false
Perhaps a rev was forgotten to be passed to searchsortedfirst?
The text was updated successfully, but these errors were encountered:
Looks like it has other bugs, too, when I try to test it more deeply:
julia> AxisKeys.findindex(Near(0.1), 3:0.1:4)
ERROR: BoundsError: attempt to access 11-element StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}} at index [0]
In 1.6.1 the following behavior changed:
1.6.0:
1.6.1:
This causes the test here
AxisKeys.jl/test/_basic.jl
Line 106 in cddf60f
The issue seems to be that the package is using
searchsortedfirst
but the range it passes in is not sorted:AxisKeys.jl/src/selectors.jl
Line 67 in cddf60f
Perhaps a
rev
was forgotten to be passed tosearchsortedfirst
?The text was updated successfully, but these errors were encountered: