style: add NPY lints to prevent use of legacy np.random - #4087
Merged
Conversation
19 tasks
np.random
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4087 +/- ##
==========================================
+ Coverage 78.59% 79.23% +0.63%
==========================================
Files 118 119 +1
Lines 12745 12669 -76
==========================================
+ Hits 10017 10038 +21
+ Misses 2728 2631 -97
Flags with carried forward coverage won't be shown. Click here to find out more.
|
ilan-gold
reviewed
Apr 24, 2026
ilan-gold
left a comment
Contributor
There was a problem hiding this comment.
Modulo the failing CI, this seems reasonable
ilan-gold
approved these changes
Apr 24, 2026
Member
Author
|
That was a bug in |
Co-authored-by: Copilot <copilot@github.com>
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.
One more for scverse/anndata#1241
Basically to move to
np.random.Generator:randandrandnare almost aliases forrandomandstandard_normal, except that they have a worse API (f(*shape)instead of the more commonf(shape)orf(..., *, size=shape))randintis renamed tointegersThere were a few leftover
np.random.seedcalls:test_notebooks.py::test_pbmc) where it basically tests that the backwards compat defaults work as expectedsimcode last time, now I did. I wonder if anyone uses it.