Skip to content

TYP: Full annotations for Array objects #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 17, 2025

Conversation

crusaderky
Copy link
Contributor

@crusaderky crusaderky commented Mar 17, 2025

Waiting for array-api-typing, I changed Array to a proper Protocol.
This highlighted a wealth of issues - notably, obfuscated error messages in case of lazy shapes.

Annoyingly, numpy.ndarray doesn't fit the protocol. I did not thoroughly investigate why but it looks like a Pandora's box well beyond the scope of this PR.

@crusaderky crusaderky changed the title Proper annotations for Array objects ENH: Full annotations for Array objects Mar 17, 2025
@crusaderky
Copy link
Contributor Author

codecov is failing because this PR modifies a couple of sparse-specific lines that the unit tests can't cover yet.

@crusaderky crusaderky marked this pull request as ready for review March 17, 2025 15:50
@crusaderky
Copy link
Contributor Author

@lucascolley rebased and ready for review

@lucascolley lucascolley self-requested a review March 17, 2025 16:18
Copy link
Member

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

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

thanks @crusaderky !

@lucascolley lucascolley added this to the 0.7.0 milestone Mar 17, 2025
@lucascolley lucascolley changed the title ENH: Full annotations for Array objects TYP: Full annotations for Array objects Mar 17, 2025
@lucascolley lucascolley removed the enhancement New feature or request label Mar 17, 2025
@lucascolley lucascolley merged commit 308fc1f into data-apis:main Mar 17, 2025
9 of 10 checks passed
@crusaderky crusaderky deleted the annotate_arrays branch March 17, 2025 18:06
NeilGirdhar pushed a commit to NeilGirdhar/array-api-extra that referenced this pull request Apr 2, 2025
* ENH: Fully annotate Array

* Update src/array_api_extra/_lib/_funcs.py

* More compact _typing.py
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