Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

TYP: fix count_nonzero signature #28774

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 2 commits into from
Apr 19, 2025

Conversation

charris
Copy link
Member

@charris charris commented Apr 19, 2025

Backport of #28750.

This fixes the following valid usage in https://github.com/data-apis/array-api-compat/blob/16978e63b744185bc4ced4677c822468e6ddebd2/array_api_compat/numpy/_aliases.py#L126-L127 from being falsely rejected:

def count_nonzero(
    x: Array,
    axis: int | tuple[int, ...] | None = None,
    keepdims: py_bool = False,
) -> Array:
    result = np.count_nonzero(x, axis=axis, keepdims=keepdims)

@charris charris added 08 - Backport Used to tag backport PRs 41 - Static typing labels Apr 19, 2025
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
@charris charris merged commit b3e772c into numpy:maintenance/2.2.x Apr 19, 2025
69 checks passed
@charris
Copy link
Member Author

charris commented Apr 19, 2025

Thanks Joren.

@charris charris deleted the backport-28750 branch April 19, 2025 13:18
@jorenham
Copy link
Member

Thanks Joren.

Right back at ya

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
08 - Backport Used to tag backport PRs 41 - Static typing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.