From 9d183e49f9ea5a5056ad82bcc9e7486c105a39ef Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Fri, 28 Aug 2026 10:13:34 +0300 Subject: [PATCH 1/3] chore: ignore pytest-parameter-with-default-argument --- pyproject.toml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 90de8b2..e578b50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,14 +85,15 @@ extend-select = [ "TC", ] extend-ignore = [ - "C90", # McCabe complexity - "multiple-spaces-before-operator", + "complex-structure", + "error-suffix-on-exception-name", "missing-whitespace-around-arithmetic-operator", - "multiple-spaces-after-comma", - "tab-after-comma", "module-import-not-at-top-of-file", - "error-suffix-on-exception-name", + "multiple-spaces-after-comma", + "multiple-spaces-before-operator", "non-empty-init-module", + "pytest-parameter-with-default-argument", + "tab-after-comma", "type-check-without-type-error", ] allowed-confusables = ["‐", "–"] From 48f871b02c100512cdca6c473c1e84a84a381d32 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Fri, 28 Aug 2026 10:17:06 +0300 Subject: [PATCH 2/3] fix: new ruff unnecessary-dunder-call errors --- modepy/quadrature/jacobi_gauss.py | 6 +++--- modepy/quadrature/kronrod.py | 6 +++--- modepy/test/test_tools.py | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modepy/quadrature/jacobi_gauss.py b/modepy/quadrature/jacobi_gauss.py index d06ed15..1f8cb32 100644 --- a/modepy/quadrature/jacobi_gauss.py +++ b/modepy/quadrature/jacobi_gauss.py @@ -265,17 +265,17 @@ def jacobi_gauss_lobatto_nodes( alpha: float, beta: float, N: int, # ruff:ignore[invalid-argument-name] backend: str | None = None, force_dim_axis: bool = False) -> ArrayF: - """Compute Gauss-Lobatto quadrature nodes associated with + r"""Compute Gauss-Lobatto quadrature nodes associated with :class:`~modepy.JacobiGaussQuadrature` with the same parameters. This helper returns only the *N+1* nodes; the corresponding Gauss-Lobatto quadrature rule (using these nodes with appropriate weights) is exact for polynomials up to degree :math:`2N - 1` - when :math:`N \\ge 1`. + when :math:`N \ge 1`. For :math:`N = 0`, this function returns a single node at ``0``. This degenerate case does not correspond to a Gauss-Lobatto node - set with endpoints :math:`\\pm 1`, but is provided for convenience. + set with endpoints :math:`\pm 1`, but is provided for convenience. """ x: np.ndarray[tuple[int, ...], np.dtype[np.floating]] = np.zeros((N + 1,)) diff --git a/modepy/quadrature/kronrod.py b/modepy/quadrature/kronrod.py index e9e5b14..ef621b5 100644 --- a/modepy/quadrature/kronrod.py +++ b/modepy/quadrature/kronrod.py @@ -608,21 +608,21 @@ def test_semi_pos_inf(): def test_semi_pos_neg(): # Semi-infinite negative: e^x from -inf to 0 - approx_int, err_est = quadgk(lambda x: np.exp(x), -np.inf, 0) + approx_int, err_est = quadgk(np.exp, -np.inf, 0) assert err_est < 1e-10 check("integral e^x from -inf to 0", approx_int, 1.0) def test_multi_break(): # Multiple breakpoints - approx_int, err_est = quadgk(lambda x: abs(x), -1, 0, 1) + approx_int, err_est = quadgk(abs, -1, 0, 1) assert err_est < 1e-10 check("integral |x| from -1 to 1 (with breakpoint)", approx_int, 1.0) def test_oscillatory(): # Oscillatory - approx_int, err_est = quadgk(lambda x: np.sin(x), 0, np.pi) + approx_int, err_est = quadgk(np.sin, 0, np.pi) assert err_est < 1e-10 check("integral sin(x) from 0 to pi", approx_int, 2.0) diff --git a/modepy/test/test_tools.py b/modepy/test/test_tools.py index 683a92e..5f29c75 100644 --- a/modepy/test/test_tools.py +++ b/modepy/test/test_tools.py @@ -823,7 +823,9 @@ def agree(x: bool, y: bool) -> bool: for a in [5, _Inf(), np.inf, -np.inf, "z"]: for b in [5, _Inf(), np.inf, -np.inf, "z"]: + # ruff: ignore[unnecessary-dunder-call] assert agree(a.__lt__(b), b.__gt__(a)) # pyright: ignore[reportArgumentType] + # ruff: ignore[unnecessary-dunder-call] assert agree(a.__le__(b), b.__ge__(a)) # pyright: ignore[reportArgumentType] From 76de73a47e054c67cae4de78da03e0f3f2f644e1 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Fri, 28 Aug 2026 10:24:32 +0300 Subject: [PATCH 3/3] chore: update baseline --- .basedpyright/baseline.json | 84 +++---------------------------------- 1 file changed, 6 insertions(+), 78 deletions(-) diff --git a/.basedpyright/baseline.json b/.basedpyright/baseline.json index 747f485..c1fadf2 100644 --- a/.basedpyright/baseline.json +++ b/.basedpyright/baseline.json @@ -4248,98 +4248,26 @@ } }, { - "code": "reportUnknownArgumentType", + "code": "reportArgumentType", "range": { "startColumn": 33, - "endColumn": 52, - "lineCount": 1 - } - }, - { - "code": "reportUnknownLambdaType", - "range": { - "startColumn": 40, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 43, - "endColumn": 52, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 50, - "endColumn": 51, + "endColumn": 39, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportArgumentType", "range": { "startColumn": 33, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownLambdaType", - "range": { - "startColumn": 40, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownLambdaType", - "range": { - "startColumn": 43, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 47, - "endColumn": 48, + "endColumn": 36, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportArgumentType", "range": { "startColumn": 33, - "endColumn": 52, - "lineCount": 1 - } - }, - { - "code": "reportUnknownLambdaType", - "range": { - "startColumn": 40, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 43, - "endColumn": 52, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 50, - "endColumn": 51, + "endColumn": 39, "lineCount": 1 } }