-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Drop index from __numpy_ufunc__ signature? out always a tuple? #5986
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
Comments
Thanks!
|
Now not specifically to #4753: indeed, I never used the index at all in my trials with But I don't know how we can do it: sadly, |
If we make sure that scipy.sparse objects continue to get priority for (Analysis: in current scipy.sparse, the binop methods do their
On Sun, Jun 21, 2015 at 1:55 PM, Charles Harris
Nathaniel J. Smith -- http://vorpus.org |
+1 to both these suggestion. Indeed, doing a loop over the array arguments and using |
It would have been useful to have this discussion earlier, but things
always happen at their own pace.
.
+0 on removing the index argument and +1 for making out always a tuple.
.
However, I know this change will break at cvxopt at the least, and maybe
other things also. There is code out there that calls ufuncs directly on
scipy sparse matrices + object arrays.
.
The only transition path I see forward is: (i) release point versions of
Scipy without the numpy_ufunc code removed ASAP, and (ii) when the
release of Numpy with numpy_ufunc is released, the release notes need to
contain a warning that it is incompatible with Scipy versions < XXX.
|
We do also have the option of renaming the method, which would definitely
|
By analogy with the old |
As we're considering changes, one hopefully small one that I'd really like to see, is for |
For example, numba has its own |
Third party extensions that already have a release with There are no backwards compatibility concerns, because nobody currently calls The main implication is that scipy will need to make another release before making using of this. |
Just answering the practical question: No issue for astropy -- I have PRs with the |
Ping here to revisit apropos #8247. |
The first commit in changing __numpy_ufunc__ by removing the index argument and making the out argument value always a tuple. These changes were proposed in numpygh-5986 and have been accepted. Renaming before further changes avoids triggering tests in scipy and astropy while keeping the numpy tests working.
Previously when __array_ufunc__ for one of the ufunc arguments was called, that arguments position was passed in the call. This PR removes that argument as proposed in numpygh-5986.
The first commit in changing __numpy_ufunc__ by removing the index argument and making the out argument value always a tuple. These changes were proposed in numpygh-5986 and have been accepted. Renaming before further changes avoids triggering tests in scipy and astropy while keeping the numpy tests working.
Previously when __array_ufunc__ for one of the ufunc arguments was called, that arguments position was passed in the call. This PR removes that argument as proposed in numpygh-5986.
The first commit in changing __numpy_ufunc__ by removing the index argument and making the out argument value always a tuple. These changes were proposed in numpygh-5986 and have been accepted. Renaming before further changes avoids triggering tests in scipy and astropy while keeping the numpy tests working.
Previously when __array_ufunc__ for one of the ufunc arguments was called, that arguments position was passed in the call. This PR removes that argument as proposed in numpygh-5986.
The first commit in changing __numpy_ufunc__ by removing the index argument and making the out argument value always a tuple. These changes were proposed in numpygh-5986 and have been accepted. Renaming before further changes avoids triggering tests in scipy and astropy while keeping the numpy tests working.
Previously when __array_ufunc__ for one of the ufunc arguments was called, that arguments position was passed in the call. This PR removes that argument as proposed in numpygh-5986.
The first commit in changing __numpy_ufunc__ by removing the index argument and making the out argument value always a tuple. These changes were proposed in numpygh-5986 and have been accepted. Renaming before further changes avoids triggering tests in scipy and astropy while keeping the numpy tests working.
Previously when __array_ufunc__ for one of the ufunc arguments was called, that arguments position was passed in the call. This PR removes that argument as proposed in numpygh-5986.
The first commit in changing __numpy_ufunc__ by removing the index argument and making the out argument value always a tuple. These changes were proposed in numpygh-5986 and have been accepted. Renaming before further changes avoids triggering tests in scipy and astropy while keeping the numpy tests working.
Previously when __array_ufunc__ for one of the ufunc arguments was called, that arguments position was passed in the call. This PR removes that argument as proposed in numpygh-5986.
The first commit in changing __numpy_ufunc__ by removing the index argument and making the out argument value always a tuple. These changes were proposed in numpygh-5986 and have been accepted. Renaming before further changes avoids triggering tests in scipy and astropy while keeping the numpy tests working.
Previously when __array_ufunc__ for one of the ufunc arguments was called, that arguments position was passed in the call. This PR removes that argument as proposed in numpygh-5986.
The first commit in changing __numpy_ufunc__ by removing the index argument and making the out argument value always a tuple. These changes were proposed in numpygh-5986 and have been accepted. Renaming before further changes avoids triggering tests in scipy and astropy while keeping the numpy tests working.
Previously when __array_ufunc__ for one of the ufunc arguments was called, that arguments position was passed in the call. This PR removes that argument as proposed in numpygh-5986.
The first commit in changing __numpy_ufunc__ by removing the index argument and making the out argument value always a tuple. These changes were proposed in numpygh-5986 and have been accepted. Renaming before further changes avoids triggering tests in scipy and astropy while keeping the numpy tests working.
Previously when __array_ufunc__ for one of the ufunc arguments was called, that arguments position was passed in the call. This PR removes that argument as proposed in numpygh-5986.
The first commit in changing __numpy_ufunc__ by removing the index argument and making the out argument value always a tuple. These changes were proposed in numpygh-5986 and have been accepted. Renaming before further changes avoids triggering tests in scipy and astropy while keeping the numpy tests working.
Previously when __array_ufunc__ for one of the ufunc arguments was called, that arguments position was passed in the call. This PR removes that argument as proposed in numpygh-5986.
The first commit in changing __numpy_ufunc__ by removing the index argument and making the out argument value always a tuple. These changes were proposed in numpygh-5986 and have been accepted. Renaming before further changes avoids triggering tests in scipy and astropy while keeping the numpy tests working.
Previously when __array_ufunc__ for one of the ufunc arguments was called, that arguments position was passed in the call. This PR removes that argument as proposed in numpygh-5986.
The first commit in changing __numpy_ufunc__ by removing the index argument and making the out argument value always a tuple. These changes were proposed in numpygh-5986 and have been accepted. Renaming before further changes avoids triggering tests in scipy and astropy while keeping the numpy tests working.
Previously when __array_ufunc__ for one of the ufunc arguments was called, that arguments position was passed in the call. This PR removes that argument as proposed in numpygh-5986.
The first commit in changing __numpy_ufunc__ by removing the index argument and making the out argument value always a tuple. These changes were proposed in numpygh-5986 and have been accepted. Renaming before further changes avoids triggering tests in scipy and astropy while keeping the numpy tests working.
Previously when __array_ufunc__ for one of the ufunc arguments was called, that arguments position was passed in the call. This PR removes that argument as proposed in numpygh-5986.
This was done in #8247 |
The first commit in changing __numpy_ufunc__ by removing the index argument and making the out argument value always a tuple. These changes were proposed in numpygh-5986 and have been accepted. Renaming before further changes avoids triggering tests in scipy and astropy while keeping the numpy tests working.
Previously when __array_ufunc__ for one of the ufunc arguments was called, that arguments position was passed in the call. This PR removes that argument as proposed in numpygh-5986.
This is a copy of #4753 (comment) by @njsmith in #4753, which I think has broader scope than the PR there:
OK, going to say something unpopular. (Certainly I'm annoyed at myself for saying it, but nonetheless...) I've been debating this with myself for a while, and I've come to the conclusion that we should bite the bullet and drop the index argument from numpy_ufunc's signature. This will require some care to avoid breaking already released versions of scipy.sparse (lesson learned: we should never have released scipy.sparse with numpy_ufunc before it came out in numpy), but that's better than leaving it forever.
Rationale:
Sorry. I'm the one who suggested adding it in the first place, but it was a bad idea :-/
Also while we're at it, we should make the out= argument unconditionally a tuple, rather than sometimes a single ndarray and sometimes a tuple of them. This would simplify argument processing (see: all the times we wrote if not isinstance(out, tuple): out = (out,) on the example binop implementations).
The text was updated successfully, but these errors were encountered: