Skip to content
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

ENH: Add ufunc.identity for hypot and logical_xor #8951

Merged
merged 1 commit into from
Apr 17, 2017

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Apr 16, 2017

Both are zero, since 0 ^ x == x, hypot(0, x) == x

Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

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

looks all OK to me, except I think it would be good to add some test cases (for empty, single element, and multiple axes?).

@eric-wieser
Copy link
Member Author

Multiple axes seems like overkill, since that's really a test of the core ufunc machinery.

I've added tests for reductions though, since they don't seem to be here at all

@mhvk
Copy link
Contributor

mhvk commented Apr 17, 2017

OK, definitely good enough! Since this is really a small (but nice!) addition, I'll go ahead and merge.

@mhvk mhvk merged commit d2a3190 into numpy:master Apr 17, 2017
@@ -248,6 +248,11 @@ regarding "workspace" sizes, and in some places may use faster algorithms.

.. _`LAPACK changelogs`: http://www.netlib.org/lapack/release_notes.html#_4_history_of_lapack_releases

``reduce`` of ``np.hypot.reduce`` and ``np.logical_xor`` allowed in more cases
Copy link
Member Author

Choose a reason for hiding this comment

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

Careless repetition of reduce here... Oops

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.

None yet

2 participants