-
Notifications
You must be signed in to change notification settings - Fork 51
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
One-line show for SparseVector #427
Conversation
Codecov Report
@@ Coverage Diff @@
## main #427 +/- ##
==========================================
+ Coverage 85.40% 85.43% +0.03%
==========================================
Files 13 13
Lines 8734 8733 -1
==========================================
+ Hits 7459 7461 +2
+ Misses 1275 1272 -3
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@jishnub fantastic! Some docstrings need fixing now that the printing changed: https://github.com/JuliaSparse/SparseArrays.jl/actions/runs/5985741971/job/16238147916?pr=427 Also, we should probably add some tests beyond the |
Updated, and added tests. I think this works now. This doesn't change the display for arrays with zero elements: julia> S = sparsevec(Int64[], Int64[], 3)
3-element SparseVector{Int64, Int64} with 0 stored entries
julia> [S]
1-element Vector{SparseVector{Int64, Int64}}:
3-element SparseVector{Int64, Int64} with 0 stored entries
julia> show(S)
sparsevec(Int64[], Int64[], 3) The difference arises as the display of |
@jishnub I believe it would make sense to also cover this case but this can be done in a separate issue, can you create one? |
In the meantime, we can merge this, thanks a lot! |
@matbesancon Please be careful about the merge option. This should have better been squashed and merged. For next time. 😉 |
Oh my bad! I usually do, it slipped here |
Fix #400 by implementing the suggestion in #400 (comment).
After this,
The displayed form is round-trippable as well.