Skip to content

Conversation

@inducer
Copy link
Owner

@inducer inducer commented Jun 25, 2025

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 inducer force-pushed the more-types-2025-06 branch 2 times, most recently from 2382812 to f3515b8 Compare June 26, 2025 00:26
@inducer inducer marked this pull request as draft June 26, 2025 02:52
@inducer inducer force-pushed the more-types-2025-06 branch 3 times, most recently from 600fea5 to 16ee9de Compare June 26, 2025 16:32
@inducer inducer marked this pull request as ready for review June 26, 2025 16:33
@inducer inducer force-pushed the more-types-2025-06 branch from 16ee9de to ce18dd3 Compare June 26, 2025 16:40
@inducer inducer marked this pull request as draft June 26, 2025 16:49
@inducer inducer force-pushed the more-types-2025-06 branch 2 times, most recently from 86bc1a0 to 8ee1030 Compare June 26, 2025 17:18
@inducer inducer requested a review from alexfikl June 26, 2025 17:30
@inducer inducer marked this pull request as ready for review June 26, 2025 17:30
@inducer inducer force-pushed the more-types-2025-06 branch 2 times, most recently from b53a97a to 385649f Compare June 26, 2025 18:55
@inducer inducer mentioned this pull request Jun 26, 2025
2 tasks
@inducer inducer marked this pull request as draft June 26, 2025 20:16
@inducer inducer force-pushed the more-types-2025-06 branch from 385649f to 7d26ffe Compare June 27, 2025 17:20
inducer added 2 commits June 27, 2025 15:45
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 inducer force-pushed the more-types-2025-06 branch from 7d26ffe to eaf8451 Compare June 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 main Jun 30, 2025
11 checks passed
@inducer inducer deleted the more-types-2025-06 branch June 30, 2025 18:11
Sign up for free to 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.

2 participants