Improve types in assignment_collection#275
Merged
inducer merged 9 commits intoinducer:mainfrom Apr 9, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR focuses on tightening type annotations around SymbolicAssignmentCollection and exposing more explicit types in sumpy.cse, along with a few small type-related touchups across the codebase and an updated basedpyright baseline.
Changes:
- Add/adjust type annotations for
SymbolicAssignmentCollectionand related helper classes. - Add type annotations to
sumpy.csepublic functions and internal helpers. - Update a few signatures/overrides in supporting modules and refresh the basedpyright baseline.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
sumpy/version.py |
Fix _parse_version to use its version parameter. |
sumpy/tools.py |
Type-annotate OrderedSet and add override usage. |
sumpy/cse.py |
Add type annotations and refactor imports/types around CSE. |
sumpy/codegen.py |
Widen assignment expression type from sym.Expr to sym.Basic. |
sumpy/assignment_collection.py |
Add types/docs to SymbolicAssignmentCollection and its symbol generator. |
sumpy/array_context.py |
Add type annotations for make_loopy_program and pytest factory overrides. |
.basedpyright/baseline.json |
Update baseline to reflect new typing work. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
Author
|
@inducer The remaining pyright failures here seem to be because inducer/pytools#350 is not released yet. Would you prefer I update the baseline without that or wait for a release? |
62e39c9 to
99c620f
Compare
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.
This essentially adds types to
SymbolicAssignmentCollectionand fixes some things around it as well.It also adds some basic types to
sumpy.cse, mainly to functions that are called from the outside. Not very sure about these, since I don't understand the algorithms / data structures used in there, butpyrightseems to not complain too much..