Add Array API support via array-api-compat#4179
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4179 +/- ##
=========================================
+ Coverage 0 79.43% +79.43%
=========================================
Files 0 120 +120
Lines 0 12871 +12871
=========================================
+ Hits 0 10224 +10224
- Misses 0 2647 +2647
Flags with carried forward coverage won't be shown. Click here to find out more.
|
flying-sheep
left a comment
There was a problem hiding this comment.
OK, please remember the comments from the fast-array-utils PR, e.g. we agreed to handle singledispatch functions like this: https://github.com/scverse/fast-array-utils/blob/febaf245ecd6da849c2331638219f649935d5a21/src/fast_array_utils/stats/_power.py#L38-L39
We also need tests. There’s MAP_ARRAY_TYPES which should gain an entry, which will make many many tests run with the type you add. We can discuss how to best exclude certain tests, for starters you can just add it and make some of the tests fail – that’ll show you where things aren’t working yet (and might or might not be fixed in this PR)
Please also add a release note (hatch run towncrier:create 4179.feat.md)
This adds Array API support to scanpy's preprocessing pipeline, where I am planning to use JAX as the test case. The goal is for someone to put a JAX array into
adata.Xand run the usual pipeline without the array getting silently pulled to CPU partway through. It builds on the recentfast-array-utilswork, which means a lot of the heavy lifting (sums, means, variances) already works across backends.