-
Notifications
You must be signed in to change notification settings - Fork 64
Respect IOContext while displaying a SparseMatrixCSC
#423
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
Conversation
IOContext while displaying a SparseMatrixCSC
Codecov Report
@@ Coverage Diff @@
## main #423 +/- ##
==========================================
+ Coverage 92.41% 92.42% +0.01%
==========================================
Files 12 12
Lines 7669 7666 -3
==========================================
- Hits 7087 7085 -2
+ Misses 582 581 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
Can we do this without introducing a new struct? I'm not sure I see the benefit of a new type for a single function. |
|
What approach would you recommend? One may duplicate the code for printing an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After thinking SGTM. You're right this is probably the least overall code.
If you wanted to do it as an iterator that would work as well.
If you could add a docstring (what it's for and state that it's not part of the public interface) I'll merge.
…#423) * Respect IOContext in printing column indices * Add docstring to ColumnIndices
* Respect IOContext in printing column indices * Add docstring to ColumnIndices
Fix #399
On main:
This PR
The main change is to use an
AbstractVectorfor the column indices instead of printing them one by one to the display, which ensures that theIOContextis automatically respected in the same way as the row indices and the values.Indexing into the
AbstractVectorisO(log n)as it usessearchsortedlast, but since this is used only in display, the performance should not matter much.