Repository navigation
chore!: add cupy stubs, reject non-csparse cupy matrices - #2716
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2716 +/- ##
==========================================
- Coverage 87.67% 85.78% -1.90%
==========================================
Files 49 49
Lines 8163 8166 +3
==========================================
- Hits 7157 7005 -152
- Misses 1006 1161 +155
|
Zethson
left a comment
There was a problem hiding this comment.
Thanks!
I could see a future where we'd want cupy COO support for n-D arrays but that's a long way off. EHRData could benefit from that.
|
should all be done together then, yeah! |
| return ss.csr_array if self.format == "csr" else ss.csc_array | ||
| return ss.csr_matrix if self.format == "csr" else ss.csc_matrix | ||
|
|
||
| def _construct( |
There was a problem hiding this comment.
Nit: I don't find this name that descriptive. The earlier memory_format seemed clearer to me (name wise).
sorry I somehow forgot to send this comment.
There was a problem hiding this comment.
welp, too late now! That method is ugly anyway, it just exists to be a type-relaxed version of memory_format that the type checker accepts when all three member arrays are np.ndarray | cupy.ndarray, would be great if there was a better way
array api (shift the burden to cupy) |
anndata rejects cupyx matrices other than CSR and CSC as X since scverse/anndata#2716, so the COO case of test_layouts_match fails against anndata's dev build on main (GPU Tests run 40924525609, hatch-test.dev-13). A COO matrix cannot enter an AnnData any more; the kernels' own COO fallback (convert to CSR) stays. Signed-off-by: Intron7 <[email protected]>
| Anyin important types at type check time, see Static typing (closes #196) mudata#218AnnData(...)with non-csr{r,c} matrices/arrays #1829 to cupyTODO: