Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements Ruff linting rule fixes (likely "Ruff152" or a batch of Ruff rules) to improve code quality and consistency across the pytato codebase. The changes focus on modernizing imports, removing unnecessary code, improving type annotations, and adding appropriate linting suppressions.
Changes:
- Removed unnecessary shebang lines from test files and examples
- Modernized import statements to use more Pythonic styles
- Improved type annotations (e.g.,
Set→AbstractSet,OrderCFsimplification,__eq__parameter types) - Simplified redundant code patterns (e.g.,
range(0, n)→range(n), unnecessary intermediate variables) - Added appropriate
noqacomments for intentional use of flagged patterns - Updated Ruff configuration to ignore specific rules where appropriate
- Removed unnecessary
passstatements in empty class bodies with docstrings
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 |
|---|---|
| test/test_pytato.py | Removed shebang, added noqa for intentional self-comparison test |
| test/test_linalg.py | Removed shebang |
| test/test_distributed.py | Optimized dictionary iteration, modernized mpi4py import |
| test/test_codegen.py | Simplified range() calls, removed intermediate variable, inline return |
| test/test_apps.py | Removed shebang |
| pytato/visualization/fancy_placeholder_data_flow.py | Removed unnecessary pass statement |
| pytato/visualization/dot.py | Converted loop to list comprehension |
| pytato/transform/metadata.py | Removed unnecessary pass statements |
| pytato/transform/init.py | Fixed logger initialization, removed unnecessary pass statement |
| pytato/target/python/init.py | Removed unnecessary pass, added noqa for intentional exec() |
| pytato/target/loopy/codegen.py | Modernized import, simplified dictionary unpacking |
| pytato/scalar_expr.py | Improved type annotations with AbstractSet, added @override decorator |
| pytato/reductions.py | Fixed eq parameter type from Any to object |
| pytato/pad.py | Modernized collections.abc import |
| pytato/distributed/partition.py | Improved type annotations, inline return, modernized import |
| pytato/diagnostic.py | Removed unnecessary pass statement |
| pytato/array.py | Multiple improvements: Literal type simplification, re.VERBOSE, exec noqa, copy() return type, import modernization, list comprehension |
| pytato/init.py | Modernized imports |
| pyproject.toml | Added S102 ignores for test files and doc/conf.py, added TRY004/TRY300 global ignores |
| examples/mpi-distributed.py | Removed shebang |
| examples/dg_tools.py | Simplified range() call |
| examples/demo.py | Removed shebang |
| examples/advection.py | Inline return statement |
| .basedpyright/baseline.json | Updated baseline reflecting type checking 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.