Repository navigation
Closes #5117: Unary Negation on ak.uint64 Does Not Match Numpy Semantics - #5124
Merged
ajpotts merged 2 commits intoDec 18, 2025
Conversation
1RyanK
force-pushed
the
5117-Unary_Negation_on_ak_uint64_Does_Not_Match_Numpy_Semantics
branch
from
December 5, 2025 16:25
bb417a4 to
f2dd364
Compare
1RyanK
force-pushed
the
5117-Unary_Negation_on_ak_uint64_Does_Not_Match_Numpy_Semantics
branch
2 times, most recently
from
December 5, 2025 19:57
bd5805c to
5c55e5b
Compare
1RyanK
marked this pull request as ready for review
December 8, 2025 12:13
ajpotts
requested changes
Dec 8, 2025
ajpotts
left a comment
Contributor
There was a problem hiding this comment.
Looks great, but I think we should include the scalar case to align with NumPy.
1RyanK
force-pushed
the
5117-Unary_Negation_on_ak_uint64_Does_Not_Match_Numpy_Semantics
branch
5 times, most recently
from
December 14, 2025 21:36
039d92a to
927fab9
Compare
1RyanK
force-pushed
the
5117-Unary_Negation_on_ak_uint64_Does_Not_Match_Numpy_Semantics
branch
from
December 16, 2025 16:52
927fab9 to
a4cb7e3
Compare
drculhane
approved these changes
Dec 16, 2025
drculhane
left a comment
Contributor
There was a problem hiding this comment.
From the looks of the operators_alignment.py, you have more in mind for this. As is, it looks good.
Contributor
Author
It's mostly just ripped out from the relevant parts of #5121 |
ajpotts
approved these changes
Dec 17, 2025
1RyanK
force-pushed
the
5117-Unary_Negation_on_ak_uint64_Does_Not_Match_Numpy_Semantics
branch
from
December 17, 2025 14:13
5ab7753 to
a41e98e
Compare
…tch_Numpy_Semantics
ajpotts
enabled auto-merge
December 18, 2025 22:45
ajpotts
approved these changes
Dec 18, 2025
ajpotts
approved these changes
Dec 18, 2025
ajpotts
disabled auto-merge
December 18, 2025 23:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since both of these are unary operators and in light of the testing framework in PR #5121, I thought I would bundle both the negation changes for
uint64andbooltogether.For unary negation on
uint64, twos complement suggests that the way to handle this is to negate the bits and add 1.For unary negation on
bool, the solution suggested was to raise aTypeErrorand suggest using~instead orlogical_not, but sincelogical_notdid not exist, I added it and have it pointing at~since they seem to largely be the same thing. I think additional tests specific tological_notwould be unnecessary if~is being tested because it's literally a wrapper for~. However, I did grab the unit tests from PR #5121 that seem relevant to this PR.Closes #5117: Unary Negation on ak.uint64 Does Not Match Numpy Semantics
Closes #5119: Bug: Unary Negation (-a) on ak.bool_ Does Not Match NumPy Semantics