Conversation
There was a problem hiding this comment.
Pull request overview
This PR applies automated Ruff linting fixes (RUF152 and related rules) to improve code quality and consistency across the sumpy codebase. The changes include import standardization, return statement simplification, type annotation improvements, and removal of unnecessary code patterns.
Changes:
- Consolidated imports from pytools and scipy to use consistent patterns
- Simplified return statements by removing intermediate variables
- Converted for-loops to list comprehensions/generator expressions where appropriate
- Improved type annotations using
SelfandAbstractSet - Removed unreachable code and unnecessary global declarations
- Updated Ruff configuration and type checker baseline
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sumpy/toys.py | Consolidated pytools imports into single line |
| sumpy/tools.py | Renamed Set to AbstractSet, simplified return statements |
| sumpy/test/test_misc.py | Simplified return statement |
| sumpy/test/test_matrixgen.py | Consolidated pytools import |
| sumpy/test/test_kernels.py | Consolidated pytools import |
| sumpy/test/test_fmm.py | Consolidated pytools import |
| sumpy/test/geometries.py | Changed scipy.fftpack import style |
| sumpy/test/curve.py | Changed scipy.fftpack import style |
| sumpy/symbolic.py | Removed unreachable raise statement |
| sumpy/qbx.py | Consolidated pytools imports, simplified return statements |
| sumpy/point_calculus.py | Consolidated pytools imports |
| sumpy/p2p.py | Consolidated pytools imports, simplified return statements |
| sumpy/p2e.py | Simplified return statements |
| sumpy/kernel.py | Changed return type to Self, converted for-loops to list comprehensions |
| sumpy/fmm.py | Consolidated pytools imports, added assertion, simplified return statements |
| sumpy/expansion/m2l.py | Simplified return statements throughout |
| sumpy/expansion/init.py | Simplified return statements, converted for-loop to extend with generator |
| sumpy/e2p.py | Consolidated pytools imports, simplified return statements |
| sumpy/e2e.py | Added override decorator and return type annotation, simplified return statements |
| sumpy/distributed.py | Consolidated pytools imports, converted for-loop to list comprehension |
| sumpy/codegen.py | Renamed Set to AbstractSet in imports, simplified return statement |
| sumpy/init.py | Removed unnecessary global declaration |
| pyproject.toml | Added Ruff rule ignores (TRY004, TRY300) and per-file ignores for S102 |
| .basedpyright/baseline.json | Updated type checker baseline after code improvements |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.