From a5f8c2923009e7b92e9b7eb09362a9938b6fd35b Mon Sep 17 00:00:00 2001 From: Mike Miller Date: Thu, 28 Mar 2024 15:04:21 +0200 Subject: [PATCH] Update pre-commit, fix two pylint warnings --- .pre-commit-config.yaml | 6 +++--- Support/Python/tbdata/printing.py | 3 +-- Support/bin/analyze_refgraph.py | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 22b25d3941..506bf6203a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,11 @@ --- repos: - repo: https://github.com/adrienverge/yamllint.git - rev: v1.34.0 + rev: v1.35.1 hooks: - id: yamllint - repo: https://github.com/psf/black - rev: 24.2.0 + rev: 24.3.0 hooks: - id: black files: ^Support/ @@ -16,7 +16,7 @@ repos: - id: flake8 files: ^Support/ - repo: https://github.com/PyCQA/pylint.git - rev: v3.0.3 + rev: v3.1.0 hooks: - id: pylint name: pylint diff --git a/Support/Python/tbdata/printing.py b/Support/Python/tbdata/printing.py index b02feca04f..5b75a455fe 100644 --- a/Support/Python/tbdata/printing.py +++ b/Support/Python/tbdata/printing.py @@ -249,8 +249,7 @@ def calculate_pos_error(cp0, cp1, middle_cps): t = (cp._dist - cp0._dist) / strip_length pos_interpolated = t * cp0._pos + (1 - t) * cp1._pos pos_error = np.linalg.norm((pos_interpolated - cp._pos)) - if pos_error > max_pos_error: - max_pos_error = pos_error + max_pos_error = max(max_pos_error, pos_error) return max_pos_error diff --git a/Support/bin/analyze_refgraph.py b/Support/bin/analyze_refgraph.py index c18a8a6bfb..d1d20da910 100755 --- a/Support/bin/analyze_refgraph.py +++ b/Support/bin/analyze_refgraph.py @@ -114,8 +114,7 @@ def iter_desired_guids(): except LookupError as e: print(e) continue - for guid in guids: - yield guid + yield from guids for guid in iter_desired_guids(): name = rg.guid_to_name.get(guid, guid)