-
Notifications
You must be signed in to change notification settings - Fork 157
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): cache indptr
for backed sparse matrices
#1266
Conversation
ilan-gold
commented
Dec 14, 2023
•
edited
Loading
edited
- Closes SparseDataset inefficient loading of indptr #1263
- Tests added
- Release note added (or unnecessary)
indptr
indptr
for backed sparse matrices
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1266 +/- ##
==========================================
+ Coverage 85.26% 85.31% +0.05%
==========================================
Files 34 34
Lines 5462 5490 +28
==========================================
+ Hits 4657 4684 +27
- Misses 805 806 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
I have spent way too long staring at the error (and trying various things to figure out why it is happening, including causing my python to segault several times). I cannot make heads or tails of why the error is happening. If I add 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.
Looks basically good. Made a few minor suggestions. A little demonstration of effect would be nice as well.
I'm assuming the error you are talking about above no longer occurs?
anndata/_core/sparse_dataset.py
Outdated
@property | ||
def group(self): | ||
return self._group |
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.
I would be okay with this being made public, but could you add a docstring + type hint for this?
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.
Yes.
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.
So the type hint appears to be unnecessary. You'll notice that some of the builds failed because of documentation issues - I honestly don't know why. The other references to Group
have no issue, but this one causes things to break. VSCode can infer the type and the docs are fine without it.
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.
Sorry I lied. The docs don't work but the type hints do work e.g., in VSCode. I was looking at the wrong Group
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.
Yeah, I have no idea why this is breaking. Extremely strange stuff. I will look again tomorrow.
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.
This looks like it's working. Can we resolve?
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.
Well I did not push the change, so the docs are building because of that, unless this works for you locally.
for more information, see https://pre-commit.ci
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.
I think everything is addressed apart from a little type hinting. Not totally sure I understand the problems you ran into, but asked some questions in comments on the code.
|
||
shape: tuple[int, int] | ||
"""Shape of the matrix.""" | ||
|
||
@property | ||
def group(self): |
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.
def group(self): | |
def group(self) -> GroupStorageType: |
Is this the change that was giving you problems with the docs?
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.
Yes!
Co-authored-by: Isaac Virshup <[email protected]>
…1296) Co-authored-by: Ilan Gold <[email protected]>