Skip to content
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

Fix documentation of findall behaviour #452

Merged
merged 1 commit into from
Oct 4, 2023
Merged

Fix documentation of findall behaviour #452

merged 1 commit into from
Oct 4, 2023

Conversation

adomasbaliuka
Copy link
Contributor

The current documentation claims that findall(!iszero, my_sparse_matrixcsc) would be "including stored entries equal to zero".

This seems counter-intuitive to me. It also seems to be wrong (unless I'm missing something):

julia> M = sparse([1, 2], [1,1], [0, 1], 2, 2)
2×2 SparseMatrixCSC{Int64, Int64} with 2 stored entries:
 0  
 1  

julia> findnz(M)
([1, 2], [1, 1], [0, 1])

julia> findall(!iszero, M)
1-element Vector{CartesianIndex{2}}:
 CartesianIndex(2, 1)

I propose to correct the documentation.

@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

Merging #452 (17cddd6) into main (05ac950) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #452   +/-   ##
=======================================
  Coverage   85.43%   85.43%           
=======================================
  Files          13       13           
  Lines        8728     8728           
=======================================
  Hits         7457     7457           
  Misses       1271     1271           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ViralBShah ViralBShah merged commit 713ab9b into JuliaSparse:main Oct 4, 2023
@ViralBShah
Copy link
Member

That's a nice catch. Thank you!

@adomasbaliuka adomasbaliuka deleted the patch-1 branch October 4, 2023 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants