Skip to content

TYP: {m,o}grid shape-typing and improved dtypes - #32739

Merged
charris merged 3 commits into
numpy:mainfrom
jorenham:typing/mgrid/shape-typing
Sep 22, 2026
Merged

charris merged 3 commits into
numpy:mainfrom
jorenham:typing/mgrid/shape-typing

Conversation

@jorenham

Copy link
Copy Markdown
Member

The __getitem__ methods of np.mgrid and np.ogrid now return shape-typed arrays for up to 3 slices. When those slices are int or float, the arrays will now also have a more accurate np.int_ / np.float64 dtype.


Pair programmed with AI.

@jorenham jorenham added this to the 2.6.0 Release milestone Sep 21, 2026
@charris

charris commented Sep 22, 2026

Copy link
Copy Markdown
Member

Needs rebase.

@jorenham
jorenham force-pushed the typing/mgrid/shape-typing branch from d5ca3e3 to 5a62fbe Compare September 22, 2026 18:48
@charris
charris merged commit e29186c into numpy:main Sep 22, 2026
15 checks passed
@charris

charris commented Sep 22, 2026

Copy link
Copy Markdown
Member

Thanks Joren.

@jorenham
jorenham deleted the typing/mgrid/shape-typing branch September 22, 2026 22:07
Riaz1729 pushed a commit to Riaz1729/numpy that referenced this pull request Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants