8000 MAINT: Split ufunc into two subtypes, and remove methods where innapropriate by eric-wieser · Pull Request #8868 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Conversation

eric-wieser
Copy link
Member
@eric-wieser eric-wieser commented Mar 30, 2017

A trial python-side only implementation of #8867.

Members that np.add and other np.scalar_ufuncs no longer have:

  • `signature

Members that np.linalg._u 8000 math_linalg and other np.gufuncs no longer have:

  • reduce
  • reduce_at
  • accumulate

np.gufunc and np.scalar_ufunc are now subclasses of np.ufunc

@njsmith
Copy link
Member
njsmith commented Mar 30, 2017

In addition to my comments on #8867, shouldn't np.add.signature be ()()->()?

If you're looking for refactorings to work on, then my suggestion would be to look at merging multiarray and umath into a single module ;-)

@eric-wieser
Copy link
Member Author

shouldn't np.add.signature be ()()->()?

That's the other direction this could be taken in, yes. I'll leave further comments to that issue.

@charris
Copy link
Member
charris commented Mar 30, 2017

Note that these sorts of things should be discussed on the mailing list.

I'm not opposed to refactoring the ufunc code, it is a mess. OTOH, ufuncs are rather specialized and tacking features onto them, gufuncs for instance, gets messy after a while. Another thing that could be useful is some specialized interfaces to nditer.

@mhvk
Copy link
Contributor
mhvk commented Jun 4, 2018

Going this route does seem quite nice. As noted in #11018 (review), it would also help to describe the signature more easily, which is different for gufuncs and ufuncs (ufuncs have where, gufuncs have axis, axes, keepdims).

@eric-wieser
Copy link
Member Author

I don't see this being an easy merge, so will close it. Something to consider in future.

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.

4 participants

0