[numpy] Update NPY201 to include exception deprecations#12065
[numpy] Update NPY201 to include exception deprecations#12065charliermarsh merged 2 commits intoastral-sh:mainfrom
numpy] Update NPY201 to include exception deprecations#12065Conversation
7b1a9b0 to
8adfff1
Compare
8adfff1 to
38ca9b8
Compare
|
I'm having trouble generating new snapshots. The current But when I add another function that is covered by the rule (as right now in the PR): np.compare_chararraysThe above I did the existing changes to the NumPy snapshot file by running the above |
|
I'll take a look. We might be hitting the limit we set on number of iterations during testing (this is just a safeguard). |
|
It seems that the fixes never converge |
|
I think more likely is that it needs more than 10 iterations due to conflicts. |
|
It seems we're only replacing one Probably because they all overlap because each of them tries to add the |
|
They probably all touch the |
|
Yeah, the cullprint is this. Which works as intended for removals but also means that it only applies one fix at the time. ruff/crates/ruff_linter/src/importer/mod.rs Lines 304 to 324 in bf5b62e An easy workaround could be to split the test into two files |
|
Yeah, or bump the limit a little bit. Either is ok with me. (We probably want a smarter strategy for this in the future.) |
|
I'll do it and merge this. |
|
I'm leaning toward splitting the tests. Many iterations can make it more difficult to debug real issues. |
|
Too late! |
|
Fair enough |
NPY201 rulenumpy] Update NPY201 to include exception deprecations
CodSpeed Performance ReportMerging #12065 will degrade performances by 5.15%Comparing Summary
Benchmarks breakdown
|
|
Thank you for solving it! One comment - the python file test is still missing these new entries added to the rule: np.DTypePromotionError
np.ModuleDeprecationWarning
np.RankWarning
np.TooHardError
np.VisibleDeprecationWarning
np.chararray
np.format_parserI didn't add them yesterday to reproduce the issue in a minimal configuration. We can still add them or leave the test as it's right now - both options are fine with me. |
Hi!
This PR updates
NPY201rule to address #12034 and partially numpy/numpy#26800.