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

[pylint] Recode nan-comparison rule to W0177 #10894

Merged
merged 1 commit into from
Apr 12, 2024
Merged

Conversation

charliermarsh
Copy link
Member

Summary

This was accidentally committed under W0117, but the actual Pylint code is W0177: https://pylint.readthedocs.io/en/latest/user_guide/checkers/features.html.

Closes #10791.

@charliermarsh charliermarsh added the bug Something isn't working label Apr 12, 2024
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+50 -50 violations, +0 -0 fixes in 2 projects; 42 projects unchanged)

PlasmaPy/PlasmaPy (+2 -2 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

- plasmapy/particles/ionization_state.py:705:12: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ plasmapy/particles/ionization_state.py:705:12: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- plasmapy/particles/particle_class.py:1944:34: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ plasmapy/particles/particle_class.py:1944:34: PLW0177 Comparing against a NaN value; use `np.isnan` instead

pandas-dev/pandas (+48 -48 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

- pandas/core/arrays/arrow/array.py:1403:29: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/arrow/array.py:1403:29: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/core/arrays/categorical.py:1563:82: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/categorical.py:1563:82: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/core/arrays/string_arrow.py:710:20: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/string_arrow.py:710:20: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/core/base.py:639:34: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/base.py:639:34: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/core/internals/managers.py:1000:48: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/internals/managers.py:1000:48: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/core/strings/accessor.py:347:63: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/strings/accessor.py:347:63: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/core/strings/object_array.py:102:28: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/strings/object_array.py:102:28: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/arithmetic/test_object.py:71:26: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arithmetic/test_object.py:71:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/arithmetic/test_object.py:75:26: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arithmetic/test_object.py:75:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/arrays/categorical/test_analytics.py:107:30: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/categorical/test_analytics.py:107:30: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/arrays/categorical/test_analytics.py:117:26: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/categorical/test_analytics.py:117:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/arrays/categorical/test_indexing.py:292:16: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/categorical/test_indexing.py:292:16: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/arrays/categorical/test_indexing.py:301:16: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/categorical/test_indexing.py:301:16: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/arrays/floating/test_contains.py:12:12: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/floating/test_contains.py:12:12: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/frame/methods/test_astype.py:762:28: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/frame/methods/test_astype.py:762:28: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/frame/methods/test_replace.py:1494:21: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/frame/methods/test_replace.py:1494:21: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/groupby/test_categorical.py:1496:20: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/groupby/test_categorical.py:1496:20: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/indexes/categorical/test_indexing.py:345:16: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/indexes/categorical/test_indexing.py:345:16: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/indexes/categorical/test_indexing.py:353:16: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/indexes/categorical/test_indexing.py:353:16: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/indexes/categorical/test_indexing.py:366:16: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/indexes/categorical/test_indexing.py:366:16: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/indexes/categorical/test_indexing.py:376:16: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/indexes/categorical/test_indexing.py:376:16: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/indexes/categorical/test_indexing.py:386:16: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/indexes/categorical/test_indexing.py:386:16: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/indexes/multi/test_indexing.py:822:16: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/indexes/multi/test_indexing.py:822:16: PLW0177 Comparing against a NaN value; use `np.isnan` instead
- pandas/tests/indexes/multi/test_indexing.py:825:16: PLW0117 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/indexes/multi/test_indexing.py:825:16: PLW0177 Comparing against a NaN value; use `np.isnan` instead
... 48 additional changes omitted for project

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
PLW0177 50 50 0 0 0
PLW0117 50 0 50 0 0

@charliermarsh charliermarsh merged commit 312f434 into main Apr 12, 2024
17 checks passed
@charliermarsh charliermarsh deleted the charlie/nan branch April 12, 2024 02:49
Glyphack pushed a commit to Glyphack/ruff that referenced this pull request Apr 12, 2024
## Summary

This was accidentally committed under `W0117`, but the actual Pylint
code is `W0177`:
https://pylint.readthedocs.io/en/latest/user_guide/checkers/features.html.

Closes astral-sh#10791.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nan-comparison code mismatch with Pylint
1 participant