refactor[cartesian]: more type hints#2088
Merged
Merged
Conversation
7f9a1d3 to
7d90804
Compare
Now that we know (in type land) that we either return a backend class or raise, we don't need all these checks for None anymore.
egparedes
approved these changes
Jun 20, 2025
Contributor
egparedes
left a comment
There was a problem hiding this comment.
LGTM. Just a suggestion to use type directly instead of typing alias Type which should not be needed anymore.
Use `tuple` as drop-in replacement for `typing.Tuple`. Use new-style type hints in all touched files (also the "new" ones added after I realized that we don't need to check anymore whether backend_cls is None.
Contributor
Author
|
cscs-ci run |
stubbiali
pushed a commit
to stubbiali/gt4py
that referenced
this pull request
Aug 19, 2025
## Description In the latest gt4py/dace bridge refactor (on the cartesian side)[^1], we slipped in a bunch of type enhancements. This PR pull out what is independent of the bridge refactor. In particular this PR brings - generically typed base registry - typed frontend and backend registries - typed `BackendCodegen` constructors - new-style type hints in touched files ## Requirements - [x] All fixes and/or new features come with corresponding tests. Covered by existing tests. - [ ] Important design decisions have been documented in the appropriate ADR inside the [docs/development/ADRs/](docs/development/ADRs/README.md) folder. N/A [^1]: see GridTools#2067 if you are interested
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.
Description
In the latest gt4py/dace bridge refactor (on the cartesian side)1, we slipped in a bunch of type enhancements. This PR pull out what is independent of the bridge refactor. In particular this PR brings
BackendCodegenconstructorsRequirements
Covered by existing tests.
N/A
Footnotes
see https://github.com/GridTools/gt4py/pull/2067 if you are interested ↩