Fix keytype and zero #574
Fixes https://github.com/JuliaSparse/SparseArrays.jl/issues/574
keytype isn't the type of the stored indices though, it should match eltype(keys(...)):
julia> v = spzeros(Int, Int32, 10)
10-element SparseVector{Int64, Int32} with 0 stored entries
julia> eltype(keys(v))
Int64
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 84.00%. Comparing base (
485fd4b) to head (8c6a370).
Additional details and impacted files
@@ Coverage Diff @@
## main #575 +/- ##
==========================================
- Coverage 84.14% 84.00% -0.15%
==========================================
Files 12 12
Lines 9160 9161 +1
==========================================
- Hits 7708 7696 -12
- Misses 1452 1465 +13
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
keytypeisn't the type of the stored indices though, it should matcheltype(keys(...)):
Should I also adapt keys then, for consistency with eachindex & length?
help?> keys
search: keys keytype KeyError haskey getkey UndefKeywordError WeakKeyDict
keys(a::AbstractArray)
Return an efficient array describing all valid indices....
No, I think keys is correct, and thus think that keytype should always be Int.
No, I think
keysis correct, and thus think thatkeytypeshould always beInt.
why?
What should do further here?
@fredrikekre Should this be closed?