Skip to content

Conversation

@dylwil3
Copy link
Collaborator

@dylwil3 dylwil3 commented Jun 8, 2025

No description provided.

@dylwil3 dylwil3 added this to the v0.12 milestone Jun 8, 2025
@dylwil3 dylwil3 added the rule Implementing or modifying a lint rule label Jun 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2025

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+94 -0 violations, +0 -0 fixes in 3 projects; 52 projects unchanged)

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

+ src/plasmapy/particles/ionization_state.py:701:12: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ src/plasmapy/particles/particle_class.py:2133:34: PLW0177 Comparing against a NaN value; use `np.isnan` instead

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

+ pandas/_testing/asserters.py:813:36: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/_testing/asserters.py:821:37: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/arrow/array.py:1458:29: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/categorical.py:1583:82: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/categorical.py:2703:46: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/string_.py:1071:39: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/string_.py:414:35: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/string_.py:857:35: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/string_.py:954:35: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/string_arrow.py:223:35: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/string_arrow.py:223:54: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/string_arrow.py:243:35: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/string_arrow.py:416:35: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/string_arrow.py:428:35: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/string_arrow.py:440:35: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/string_arrow.py:468:35: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/arrays/string_arrow.py:485:35: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/base.py:681:34: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/dtypes/cast.py:1109:43: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/indexes/base.py:5486:40: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/internals/managers.py:994:48: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/strings/accessor.py:366:63: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/core/strings/object_array.py:109:28: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arithmetic/test_object.py:69:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arithmetic/test_object.py:73:26: PLW0177 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: PLW0177 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: PLW0177 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/arrays/string_/test_string.py:100:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/string_/test_string.py:106:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/string_/test_string.py:115:59: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/string_/test_string.py:118:58: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/string_/test_string.py:293:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/string_/test_string.py:312:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/string_/test_string.py:339:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/string_/test_string.py:366:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/string_/test_string.py:366:56: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/string_/test_string.py:418:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/string_/test_string.py:505:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/string_/test_string.py:624:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/string_/test_string.py:670:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/string_/test_string.py:683:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/string_/test_string.py:700:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/arrays/string_/test_string.py:713:26: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/extension/base/methods.py:69:78: PLW0177 Comparing against a NaN value; use `np.isnan` instead
+ pandas/tests/extension/test_string.py:120:30: PLW0177 Comparing against a NaN value; use `np.isnan` instead
... 43 additional changes omitted for project

astropy/astropy (+1 -0 violations, +0 -0 fixes)

+ astropy/time/core.py:1200:46: PLW0177 Comparing against a NaN value; use `np.isnan` instead

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PLW0177 94 94 0 0 0

Linter (preview)

✅ ecosystem check detected no linter changes.

@ntBre ntBre force-pushed the brent/release-0.12.0 branch from 0370d8a to 040fb6b Compare June 8, 2025 19:55
@ntBre ntBre requested a review from AlexWaygood as a code owner June 8, 2025 19:55
@ntBre ntBre force-pushed the brent/release-0.12.0 branch from 040fb6b to 9252447 Compare June 8, 2025 20:18
@AlexWaygood AlexWaygood removed their request for review June 8, 2025 20:29
@ntBre ntBre force-pushed the brent/release-0.12.0 branch from 9252447 to 829acf4 Compare June 9, 2025 00:22
@dylwil3 dylwil3 force-pushed the dylan/stabilize-plw0177 branch from 53305fd to 87f9040 Compare June 9, 2025 13:04
@ntBre
Copy link
Contributor

ntBre commented Jun 9, 2025

These is np.nan comparisons in the ecosystem do appear to work, but I think it's still reasonable to emit the diagnostic. For example,

>>> import numpy as np
>>> np.nan is np.nan
True
>>> np.nan is float("nan")
False
>>> np.isnan(float("nan"))
np.True_

isnan is still better in case you somehow get a NaN from outside numpy.

@dylwil3 dylwil3 force-pushed the dylan/stabilize-plw0177 branch from 87f9040 to 529ac66 Compare June 9, 2025 18:15
@dylwil3 dylwil3 merged commit b4aac35 into brent/release-0.12.0 Jun 9, 2025
34 checks passed
@dylwil3 dylwil3 deleted the dylan/stabilize-plw0177 branch June 9, 2025 19:05
@dylwil3 dylwil3 mentioned this pull request Jun 9, 2025
2 tasks
ntBre pushed a commit that referenced this pull request Jun 10, 2025
ntBre pushed a commit that referenced this pull request Jun 11, 2025
ntBre pushed a commit that referenced this pull request Jun 11, 2025
ntBre pushed a commit that referenced this pull request Jun 12, 2025
ntBre pushed a commit that referenced this pull request Jun 16, 2025
ntBre pushed a commit that referenced this pull request Jun 17, 2025
ntBre pushed a commit that referenced this pull request Jun 17, 2025
carljm added a commit to MatthewMckee4/ruff that referenced this pull request Jun 17, 2025
…ence

* main: (71 commits)
  Bump 0.12.0 (astral-sh#18724)
  Revert "[ty] Offer "Did you mean...?" suggestions for unresolved `from` imports and unresolved attributes (astral-sh#18705)" (astral-sh#18721)
  [`flake8-return`] Stabilize only add `return None` at the end when fixing `implicit-return` (`RET503`) (astral-sh#18516)
  [`pyupgrade`] Stabilize `non-pep695-generic-function` (`UP047`) (astral-sh#18524)
  [`pyupgrade`] Stabilize `non-pep695-generic-class` (`UP046`) (astral-sh#18519)
  [`pandas-vet`] Deprecate `pandas-df-variable-name` (`PD901`) (astral-sh#18618)
  [`flake8-bandit`] Remove `suspicious-xmle-tree-usage` (`S320`) (astral-sh#18617)
  Stabilize `dataclass-enum` (`RUF049`) (astral-sh#18570)
  Stabilize `unnecessary-dict-index-lookup` (`PLR1733`) (astral-sh#18571)
  Remove rust-toolchain.toml from sdist (astral-sh#17925)
  Stabilize `starmap-zip` (`RUF058`) (astral-sh#18525)
  [`flake8-logging`] Stabilize `exc-info-outside-except-handler` (`LOG014`) (astral-sh#18517)
  [`pyupgrade`] Stabilize `non-pep604-annotation-optional` (`UP045`) and preview behavior for `non-pep604-annotation-union` (`UP007`) (astral-sh#18505)
  Stabilize `pytest-warns-too-broad` (`PT030`) (astral-sh#18568)
  Stabilize `for-loop-writes` (`FURB122`) (astral-sh#18565)
  Stabilize `pytest-warns-with-multiple-statements` (`PT031`) (astral-sh#18569)
  Stabilize `pytest-parameter-with-default-argument` (`PT028`) (astral-sh#18566)
  Stabilize `nan-comparison` (`PLW0177`) (astral-sh#18559)
  Stabilize `check-and-remove-from-set` (`FURB132`) (astral-sh#18560)
  Stabilize `unnecessary-round` (`RUF057`) (astral-sh#18563)
  ...
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.

3 participants