Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[numpy] Update NPY201: add np.NAN to exception #12292

Merged
merged 3 commits into from
Jul 12, 2024

Conversation

xmatthias
Copy link
Contributor

Summary

np.NAN was also deprecated / removed, as reported in #12195.

Personally, i'd also wan't to have warnings for from numpy import nan, NaN, NAN (NAN and NaN shouldn't import as they've been removed) - but that's really out of my league - as there's no similar case at the moment (at least not in the NPY201 section).
Obviously, this would "also" apply to essentially all other cases of deprecations.

Test Plan

Added testcase, manual test

@@ -68,3 +68,5 @@ def func():
np.longfloat(12+34j)

np.lookfor

np.NAN
Copy link
Contributor Author

@xmatthias xmatthias Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could also be moved next to np.NaN - which i'd find more appealing as it'd really belong there - but i found the diff on the .snap file to be rather large - as it changes all subsequent line numbers...

let me know if you'd prefer that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think either is fine.

@MichaReiser
Copy link
Member

Personally, i'd also wan't to have warnings for from numpy import nan, NaN, NAN (NAN and NaN shouldn't import as they've been removed) - but that's really out of my league - as there's no similar case at the moment (at least not in the NPY201 section).

That makes sense. I think that's best tackled as a separate pr

@MichaReiser MichaReiser added the rule Implementing or modifying a lint rule label Jul 12, 2024
@MichaReiser MichaReiser changed the title [numpy] Update NPY201: add np.NAN to exception [numpy] Update NPY201: add np.NAN to exception Jul 12, 2024
@MichaReiser
Copy link
Member

Thank you!

@MichaReiser MichaReiser enabled auto-merge (squash) July 12, 2024 12:06
@MichaReiser MichaReiser merged commit 17e84d5 into astral-sh:main Jul 12, 2024
18 checks passed
@xmatthias xmatthias deleted the fix/npy201_NAN branch July 12, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants