Skip to content

Conversation

dpinol
Copy link
Contributor

@dpinol dpinol commented Oct 25, 2024

Fixes #574

@fredrikekre
Copy link
Member

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

Copy link

codecov bot commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dpinol
Copy link
Contributor Author

dpinol commented Oct 25, 2024

keytype isn't the type of the stored indices though, it should match eltype(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....

@fredrikekre
Copy link
Member

No, I think keys is correct, and thus think that keytype should always be Int.

@dpinol
Copy link
Contributor Author

dpinol commented Oct 25, 2024

No, I think keys is correct, and thus think that keytype should always be Int.

why?

@ViralBShah
Copy link
Member

What should do further here?

@ViralBShah
Copy link
Member

@fredrikekre Should this be closed?

@ViralBShah ViralBShah marked this pull request as draft February 20, 2025 22:03
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zero & keytype always return Int64 for the index type
3 participants