feat: switch to use and out - #4359
Draft
flying-sheep wants to merge 4 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4359 +/- ##
=========================================
+ Coverage 0 81.92% +81.92%
=========================================
Files 0 134 +134
Lines 0 12794 +12794
=========================================
+ Hits 0 10482 +10482
- Misses 0 2312 +2312
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current design:
copyeverywhereuseandout– default foroutis to operate in place,out=Nonemeans returning the matrix instead of writing it into AnnData.out=Truecould mean return andout=Falseinplace, that way users could specify it intentionallykey_added/inplacefor the same functionality, likeNeighbors(dists=A.obsp["foo"], conns=A.obsp["bar"], meta=A.uns["foo"])(whereA.unsdoesn’t even exist yet)NamedTuples or so for the spots used. Probably what @ilan-gold would prefer, but we should meet to spec this out.Examples for
use/out(key_addedis unchanged):outmakes the singledispatch use some functions have (sc.pp.log1p(adata.X)) unnecessaary, so we might deprecate that, what do you think?Example for how this improves code:
TODO:
useneeds to be consistently documenteduse_rawneeds deprecatingvar["mean"]/["std"]underout=None, should maybe gain areturn_statsparameter or soregress_outcopies a backed array before rejecting itanndata.accreplacement for functions takingobsm,layer, … #4334, closes Remove inplace/copy #2583