Skip to content

Towards grudge typing - #322

Merged
inducer merged 2 commits into
mainfrom
more-types-2025-06
Jun 30, 2025
Merged

Towards grudge typing#322
inducer merged 2 commits into
mainfrom
more-types-2025-06

Conversation

@inducer

@inducerinducer commented Jun 25, 2025

Copy link
Copy Markdown
Owner

This improves many aspects of typing in arraycontext:

  • It adds more types in the base fake numpy and shifts some implementation aspects there. This point is a fairly big deal in terms of type safety:
    • First, it defines the interface against which user applications are checked.
    • Second, the actx implementations get checked against that interface.
  • It improves type checking (and consistency) in the traversals.
    • It allows scalars consistently.
    • It adds some overloads for traversal functions.
    • It adds rec_map_container, which is simpler (and easier to type).
  • It makes array containers recognizable to the type checker.
    This works via a heuristic, by having __array_ufunc__ == None.

Still needed:

@inducer
inducerforce-pushed the more-types-2025-06 branch 2 times, most recently from 2382812 to f3515b8CompareJune 26, 2025 00:26
@inducer
inducer marked this pull request as draft June 26, 2025 02:52
@inducer
inducerforce-pushed the more-types-2025-06 branch 3 times, most recently from 600fea5 to 16ee9deCompareJune 26, 2025 16:32
@inducer
inducer marked this pull request as ready for review June 26, 2025 16:33
@inducer
inducerforce-pushed the more-types-2025-06 branch from 16ee9de to ce18dd3CompareJune 26, 2025 16:40
@inducer
inducer marked this pull request as draft June 26, 2025 16:49
@inducer
inducerforce-pushed the more-types-2025-06 branch 2 times, most recently from 86bc1a0 to 8ee1030CompareJune 26, 2025 17:18
@inducer
inducer requested a review from alexfiklJune 26, 2025 17:30
@inducer
inducer marked this pull request as ready for review June 26, 2025 17:30
@inducer
inducerforce-pushed the more-types-2025-06 branch 2 times, most recently from b53a97a to 385649fCompareJune 26, 2025 18:55
@inducerinducer mentioned this pull request Jun 26, 2025
2 tasks
@inducer
inducer marked this pull request as draft June 26, 2025 20:16
@inducer
inducerforce-pushed the more-types-2025-06 branch from 385649f to 7d26ffeCompareJune 27, 2025 17:20
This improves many aspects of typing in arraycontext:
- It improves type checking (and consistency) in the traversals.
- It allows scalars consistently.
- It adds some overloads for traversal functions.
- It adds `rec_map_container`, which is simpler (and easier to type).
- It makes array containers recognizable to the type checker.
This works via a heuristic, by having `__array_ufunc__ == None`.
- It adds more types in the base fake numpy and shifts
some implementation aspects there.
@inducer
inducerforce-pushed the more-types-2025-06 branch from 7d26ffe to eaf8451CompareJune 27, 2025 20:45
@inducer
inducer marked this pull request as ready for review June 29, 2025 19:30
@inducer
inducer merged commit 33c0f0d into mainJun 30, 2025
@inducer
inducer deleted the more-types-2025-06 branch June 30, 2025 18:11
Sign up for freeto 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

@inducer