Skip to content

Comments

Ruf152#158

Merged
inducer merged 2 commits intomainfrom
ruf152
Feb 20, 2026
Merged

Ruf152#158
inducer merged 2 commits intomainfrom
ruf152

Conversation

@inducer
Copy link
Owner

@inducer inducer commented Feb 20, 2026

Closes #157.

Copilot AI review requested due to automatic review settings February 20, 2026 20:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR applies code simplifications and modernizations aligned with Ruff linting rule RUF152, focusing on cleaner code patterns and modern typing conventions.

Changes:

  • Modernized Protocol typing by using Self instead of custom TypeVar for self-referential types
  • Simplified code patterns: inline returns, using max() instead of if-statements, and direct file iteration
  • Updated Ruff configuration to allow exec() usage in test files and documentation, and to ignore TRY004
  • Updated type checking baseline to reflect the typing improvements

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pyproject.toml Added S102 exclusions for test files and doc/conf.py (allowing exec), added TRY004 to global ignore list
modepy/tools.py Replaced TypeVar with Self in Reshapeable Protocol, updated matplotlib.tri import style
modepy/modal_decay.py Simplified return statement and replaced if-statement with max() function
contrib/weights-from-txt.py Removed unnecessary .readlines() call when iterating over file
contrib/weights-from-fortran.py Removed shebang line for consistency with other contrib scripts
.basedpyright/baseline.json Updated type checking baseline reflecting the Protocol typing changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@inducer inducer merged commit 75f2227 into main Feb 20, 2026
17 checks passed
@inducer inducer deleted the ruf152 branch February 20, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant