Skip to content

Commit

Permalink
Add more NPY002 violations (#9862)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-mcivor committed Feb 7, 2024
1 parent e9ddd48 commit aa38307
Show file tree
Hide file tree
Showing 3 changed files with 292 additions and 267 deletions.
4 changes: 3 additions & 1 deletion crates/ruff_linter/resources/test/fixtures/numpy/NPY002.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
numpy.random.get_state()
numpy.random.set_state()
numpy.random.rand()
numpy.random.ranf()
numpy.random.sample()
numpy.random.randn()
numpy.random.randint()
numpy.random.random()
numpy.random.random_integers()
numpy.random.random_sample()
numpy.random.choice()
Expand All @@ -35,7 +38,6 @@
numpy.random.f()
numpy.random.gamma()
numpy.random.geometric()
numpy.random.get_state()
numpy.random.gumbel()
numpy.random.hypergeometric()
numpy.random.laplace()
Expand Down
3 changes: 3 additions & 0 deletions crates/ruff_linter/src/rules/numpy/rules/legacy_random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ pub(crate) fn legacy_random(checker: &mut Checker, expr: &Expr) {
"set_state" |
// Simple random data
"rand" |
"ranf" |
"sample" |
"randn" |
"randint" |
"random" |
"random_integers" |
"random_sample" |
"choice" |
Expand Down

0 comments on commit aa38307

Please sign in to comment.