-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
DEP: deprecate ndarray.conjugate's no-op fall through for non-numeric types #9060
Conversation
Excellent, this exhibits the same UI bug |
@@ -420,6 +420,18 @@ def test_int_dtypes(self): | |||
self.assert_deprecated(op.div, args=(a,b)) | |||
dt2 = dt1 | |||
|
|||
class TestNonNumericConjugate(_DeprecationTestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: should have another blank line before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed; was copying the style immediately above which is single-spaced!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mirroring my approval from the other PR. Would be good to have a second opinion on the deprecation before merging, but otherwise I'd hope this can make 1.13
Sounds good! The deprecation and bugfix commits are actually independent now; would it be helpful if I split them into separate PRs? |
Yeah, I guess if you did that I could at least pull the trigger on the bugfix without any further opinions |
☔ The latest upstream changes (presumably #8939) made this pull request unmergeable. Please resolve the merge conflicts. |
I copied over the description from #9003. |
Needs rebase on account of the release notes. |
Yikes,
That definitely looks like an unexpected result that needs a future warning and fix. Although I see that this does not affect that behavior. |
types This behavior is contrary to np.conjugate (which will error on non-numeric types), even though documentation claims they are identical. This deprecation favors failing fast.
The original patch did, but this came with a hefty performance cost for It would be nice if |
I've rebased and rewritten the description, since the old one didn't make a lot of sense here. (Keeping in mind that this PR is about something else:) |
While
np.conjugate
errors on non-numeric types,ndarray.conjugate
silently returns its argument, even though both are documented as being equivalent. This is due to a fall-through condition inndarray.conjugate
which is useful for real data (e.g., https://github.com/numpy/numpy/blob/master/numpy/lib/function_base.py#L3087) but not meaningful for non-numeric data.This PR deprecates the fall-through for non-numeric dtypes, bringing
ndarray.conjugate
closer tonp.conjugate
by favoring its fail-fast behavior.This was originally part of #9003.