From e82631205ded565aca643e927eb6ffa77f812086 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Fri, 20 Feb 2026 16:43:00 +0200 Subject: [PATCH 1/3] fix: some non-enabled ruff errors --- contrib/weights-from-txt.py | 2 +- modepy/modal_decay.py | 4 +--- modepy/tools.py | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/contrib/weights-from-txt.py b/contrib/weights-from-txt.py index daf1297e..e4160739 100755 --- a/contrib/weights-from-txt.py +++ b/contrib/weights-from-txt.py @@ -5,7 +5,7 @@ with open(sys.argv[1]) as inf: - lines = [ln.strip() for ln in inf.readlines() if ln.strip()] + lines = [line for ln in inf if (line := ln.strip())] rule_name = sys.argv[2] diff --git a/modepy/modal_decay.py b/modepy/modal_decay.py index 5e9785a1..e71854a2 100644 --- a/modepy/modal_decay.py +++ b/modepy/modal_decay.py @@ -152,9 +152,7 @@ def skyline_pessimize(modal_values: ArrayF) -> ArrayF: cur_val = max(my_modes[-1], my_modes[-2]) for imode in range(nmodes-1, -1, -1): - if my_modes[imode] > cur_val: - cur_val = my_modes[imode] - + cur_val = max(cur_val, my_modes[imode]) result[iel, imode] = cur_val return result diff --git a/modepy/tools.py b/modepy/tools.py index 15fae8bd..357a24fd 100644 --- a/modepy/tools.py +++ b/modepy/tools.py @@ -292,7 +292,7 @@ def plot_element_values( pt.plot(orig_nodes[0], orig_values, "x") elif dims == 2: import matplotlib.pyplot as pt - import matplotlib.tri as tri + from matplotlib import tri triangulation = tri.Triangulation(nodes[0], nodes[1], triangles=submesh) ax = pt.subplot(1, 1, 1, projection="3d") From b3cb9826b716a951462d452a83c2ec7f8d5d51b1 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Fri, 20 Feb 2026 16:43:31 +0200 Subject: [PATCH 2/3] chore: use select instead of extend-select for ruff --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 367484fb..01e15fc6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,7 +67,7 @@ exclude = [ preview = true [tool.ruff.lint] -extend-select = [ +select = [ "B", # flake8-bugbear "C", # flake8-comprehensions "E", # pycodestyle From c38b447791b82a5f5951126bb0394587eee7a7b0 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Fri, 20 Feb 2026 16:58:04 +0200 Subject: [PATCH 3/3] chore: update baseline --- .basedpyright/baseline.json | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.basedpyright/baseline.json b/.basedpyright/baseline.json index 91086ad5..d23817cb 100644 --- a/.basedpyright/baseline.json +++ b/.basedpyright/baseline.json @@ -1338,8 +1338,24 @@ { "code": "reportAny", "range": { - "startColumn": 16, - "endColumn": 23, + "startColumn": 12, + "endColumn": 19, + "lineCount": 1 + } + }, + { + "code": "reportAny", + "range": { + "startColumn": 26, + "endColumn": 33, + "lineCount": 1 + } + }, + { + "code": "reportAny", + "range": { + "startColumn": 35, + "endColumn": 50, "lineCount": 1 } }, @@ -4659,22 +4675,6 @@ "lineCount": 1 } }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 11, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 11, - "endColumn": 40, - "lineCount": 1 - } - }, { "code": "reportUnknownMemberType", "range": {