Skip to content

♻️ Move _ShapeLike from numpy._typing to _numtype.ToShape#854

Merged
jorenham merged 8 commits intonumpy:mainfrom
Aniketsy:fix-565
Apr 19, 2026
Merged

♻️ Move _ShapeLike from numpy._typing to _numtype.ToShape#854
jorenham merged 8 commits intonumpy:mainfrom
Aniketsy:fix-565

Conversation

@Aniketsy
Copy link
Copy Markdown
Contributor

fixes #565

  • Move _ShapeLike from private numpy._typing to public _numtype module .
  • there were 695 reference

@jorenham just helping with this refactor 😊
please let me know if there is preferred approach for this refactor or we need any improvements

Copy link
Copy Markdown
Member

@jorenham jorenham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Linting issues aside, I'd prefer we now refer to _nt.ShapeLike directly, rather than introducing new type aliases in every module that uses it.

@Aniketsy
Copy link
Copy Markdown
Contributor Author

Linting issues aside, I'd prefer we now refer to _nt.ShapeLike directly, rather than introducing new type aliases in every module that uses it.

yes, i was thinking for this but wasn’t completely sure .Thanks! I’ll use _nt.ShapeLike directly. also does this means we need to refactor similarly for other refactors also.

Comment thread src/numpy-stubs/_core/umath.pyi
@Aniketsy
Copy link
Copy Markdown
Contributor Author

i'll be fixing these lint errors shortly

@Aniketsy Aniketsy marked this pull request as draft April 12, 2026 19:31
@Aniketsy Aniketsy marked this pull request as ready for review April 13, 2026 11:50
@jorenham jorenham self-requested a review April 15, 2026 22:36
Comment thread src/_numtype/_shape.pyi Outdated
Comment thread src/numpy-stubs/_core/defchararray.pyi Outdated
Comment thread src/numpy-stubs/_typing/_shape.pyi Outdated
Comment thread src/numpy-stubs/lib/_shape_base_impl.pyi Outdated
@Aniketsy
Copy link
Copy Markdown
Contributor Author

thanks for the review, i've update to _nt.ToShape, please let me know if we need any further improvement.

@jorenham jorenham changed the title Move _ShapeLike from numpy._typing to public numtype ♻️ Move _ShapeLike from numpy._typing to _numtype.ToShape Apr 18, 2026
@jorenham
Copy link
Copy Markdown
Member

should be ready to merge once the ruff errors are taken care of

@Aniketsy
Copy link
Copy Markdown
Contributor Author

aniket@DESKTOP-074O80J:/mnt/d/numtype/numtype$ uv run ruff check --fix
All checks passed!

😿

@jorenham
Copy link
Copy Markdown
Member

uv run ruff format

@Aniketsy
Copy link
Copy Markdown
Contributor Author

uv run ruff format

yes, sorry i thought i run this

Comment thread src/numpy-stubs/_typing/__init__.pyi Outdated
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
@jorenham jorenham merged commit c11ed75 into numpy:main Apr 19, 2026
21 checks passed
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.

move numpy._typing._ShapeLike to numtype

2 participants