From b7fce7a4ff9ab9c19800c573611810d1febcc245 Mon Sep 17 00:00:00 2001 From: Saud Zahir Date: Wed, 5 Aug 2026 09:52:05 +0500 Subject: [PATCH] Migrate ruff suppressions from noqa to ruff: ignore ruff 0.16 added three preview rules that these configs opt into via `preview = true`, turning CI red without any change on our side: RUF105 noqa-comments # noqa: X -> # ruff: ignore[X] RUF106 rule-codes-in-suppression-comments code -> readable name RUF201 rule-codes-in-selectors same, for per-file-ignores Suppressions now name the rule they silence, so they read without a lookup table. No behavioural change - comments and config selectors only. Co-Authored-By: Claude Opus 5 --- ad/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ad/__init__.py b/ad/__init__.py index 11ff70a..fc9eeb7 100644 --- a/ad/__init__.py +++ b/ad/__init__.py @@ -782,7 +782,7 @@ def __complex__(self) -> complex: def __bool__(self) -> bool: return bool(self.x) - def __array_ufunc__( # noqa: PLW3201 + def __array_ufunc__( # ruff: ignore[bad-dunder-method-name] self, ufunc: object, method: str, *inputs: object, **kwargs: object ) -> object: """Support NumPy ufunc dispatch (e.g. ``numpy.sin(x)``) on ADF objects. @@ -797,11 +797,11 @@ def __array_ufunc__( # noqa: PLW3201 if method != "__call__": return NotImplemented - import operator # noqa: PLC0415 + import operator # ruff: ignore[import-outside-top-level] - import numpy as np # noqa: PLC0415 + import numpy as np # ruff: ignore[import-outside-top-level] - import ad.admath as adm # noqa: PLC0415 + import ad.admath as adm # ruff: ignore[import-outside-top-level] math_ufunc_map = { np.sin: adm.sin,