-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
good first issueGood for newcomersGood for newcomershelp wantedContributions especially welcomeContributions especially welcomeruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
Using the following test file should show multiple deprecation warnings - but only shows one while using ruff 0.5.0 (the latest afaik).
from numpy import nan, NaN, NAN
import numpy as np
np.NaN
np.NAN
np.nanruff check test_npy.py --preview --select NPY2
test_npy.py:5:1: NPY201 [*] `np.NaN` will be removed in NumPy 2.0. Use `numpy.nan` instead.
|
3 | import numpy as np
4 |
5 | np.NaN
| ^^^^^^ NPY201
6 | np.NAN
7 | np.nan
|
= help: Replace with `numpy.nan`
Found 1 error.
[*] 1 fixable with the `--fix` option
In reality, np.NAN is also not valid, so should raise an error, too.
Also, explicit imports (not used through np.xxx) seem to be completely ignored ...
Neither is from numpy import NaN, NAN (only from numpy import nan is still valid for numpy2.0).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedContributions especially welcomeContributions especially welcomeruleImplementing or modifying a lint ruleImplementing or modifying a lint rule