docs: document array type support
- [x] Closes #3892
- [x] Tests included or not required because:
- [ ] Release notes not necessary because:
I double-checked everything in #2578 and mostly winged it for the rest.
Would be nice if one of you could take a look if I mis-specified something.
- I didn’t check if some flavors of
highly_variable_genessupports only CSR. Any idea? - I tried to document things that implicitly convert to
csras “not supporting csc”, except when that’s conditional (i.esc.pp.scalesupports CSC if you don’t specifymask_obs, so that’s detailed inmask_obs).
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 76.80%. Comparing base (b85d814) to head (c9c352b).
:warning: Report is 1 commits behind head on main.
:white_check_mark: All tests successful. No failed tests found.
Additional details and impacted files
@@ Coverage Diff @@
## main #3895 +/- ##
==========================================
+ Coverage 76.77% 76.80% +0.03%
==========================================
Files 116 117 +1
Lines 12398 12440 +42
==========================================
+ Hits 9518 9554 +36
- Misses 2880 2886 +6
| Flag | Coverage Δ | |
|---|---|---|
| hatch-test.pre | 76.80% <100.00%> (+0.03%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| src/scanpy/_utils/_docs.py | 100.00% <100.00%> (ø) |
|
| ...c/scanpy/experimental/pp/_highly_variable_genes.py | 18.44% <ø> (ø) |
|
| src/scanpy/get/_aggregated.py | 92.78% <ø> (ø) |
|
| src/scanpy/neighbors/__init__.py | 80.05% <ø> (ø) |
|
| src/scanpy/preprocessing/_combat.py | 88.46% <ø> (ø) |
|
| src/scanpy/preprocessing/_highly_variable_genes.py | 94.71% <ø> (ø) |
|
| src/scanpy/preprocessing/_normalization.py | 94.66% <ø> (ø) |
|
| src/scanpy/preprocessing/_pca/__init__.py | 90.65% <ø> (ø) |
|
| src/scanpy/preprocessing/_qc.py | 95.83% <ø> (ø) |
|
| src/scanpy/preprocessing/_scale.py | 91.20% <ø> (ø) |
|
| ... and 15 more |
How hard would it be to make an overview page that lists all functions in a single table?
@flying-sheep I'll try to look tomorrow more closely but I do like @grst's suggestion. That being said, I don't think it should be instead of what is here, this is really cool!
Can you draft how that would look like? Tables for something like PCA are already quite big, and I can’t imagine how to lay out one big table in a way that it would be clear what’s going on.
I had in mind something like this
✅ = supported ❌ = not supported ⚡= supported in dask
| Function | numpy.ndarray | csr_array | csr_matrix | csc_array | csc_matrix |
|---|---|---|---|---|---|
| sc.tl.pca | ✅⚡ | ✅⚡ | ✅⚡ | ✅ | ✅ |
| sc.tl.tsne | ✅ | ✅ | ✅ | ❌ | ❌ |
| sc.tl.umap | ✅⚡ | ✅ | ✅ | ❌ | ❌ |
| ... |
@flying-sheep I have not checked how this work or not. But do umap and tsne work with sp_matrix and arrays?
Yes! In umap, doing sc.pp.neighbors(adata, use_rep="X") results in X being passed to simplicial_set_embedding, which will do a TruncatedSVD on it.
TSNE calls validate_data(self, X, accept_sparse=["csr", "csc", "coo"], ...) which very likely also means it supports it.
Thanks, thinking like this is exactly the reason I requested your reviews! Could have easily been that I messed this up.
The table leads to horizontal scrolling for me
Also not sure if the top of the API page is the best place to place it? Maybe even have a dedicated page for it?