Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

BUG: safer bincount casting (backport to 2.2.x)#28420

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@jakirkham
Copy link
Contributor

Backport of PR (#28355 ) to2.2.x

cc@tylerjereddy@seberg@charris

* BUG: safer bincount casting*Fixesnumpy#28354* Force usage of `npy_intp` type in `np.bincount()` and avoidunsafe casting errors with i.e., `npy_uint64`. This is similarto our behavior with indexing.* MAINT, BUG: PR 28355 revisions* `arr_bincount()` now only uses unsafe casting for integerinput types, and the number of casting operations hasbeen reduced for the code path used in above PR.* a test for non-crashing behavior with non-contiguous`bincount()` input has been added.* MAINT, BUG: PR 28355 revisions* Based on reviewer feedback, narrow the scope of the `flags`variable in `arr_bincount()`.* Based on reviewer feedback, add an array-like test for the `uint64`casting issue, which indeed fails before and passes after addinga similar shim to the array-like code path in `arr_bincount()`.* Based on reviewer feedback, switch the patching from `PyArray_Size`to `PyArray_Check` in a few places.* Update numpy/_core/src/multiarray/compiled_base.c---------Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
@jorenhamjorenham added the 08 - BackportUsed to tag backport PRs labelMar 3, 2025
@charrischarris added this to the2.2.4 release milestoneMar 3, 2025
@charrischarris merged commita9d3796 intonumpy:maintenance/2.2.xMar 3, 2025
70 checks passed
@charris
Copy link
Member

Thanks@jakirkham .

@jakirkhamjakirkham deleted the backport_treddy_issue_28354_2.2.x branchMarch 3, 2025 21:49
@jakirkham
Copy link
ContributorAuthor

Thanks Chuck! 🙏

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

00 - Bug08 - BackportUsed to tag backport PRs

Projects

None yet

Milestone

2.2.4 release

Development

Successfully merging this pull request may close these issues.

4 participants

@jakirkham@charris@jorenham@tylerjereddy

[8]ページ先頭

©2009-2025 Movatter.jp