-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Scipy sparse inplace fails after __array_ufunc__ merge #9019
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
Probably missing priority forwarding for inplace operators. |
Probably indeed
current master:
|
Hmm, we are still depending on ufuncs returning |
This fixes the inplace add
The result is that a is replaced by a matrix, python rules, but that is as before. I seems that all the inplace operators suffer the same omission. Major test failure ;) |
@juliantaylor What happens to the elision code if the inplace function returns EDIT: Looks like that is already checked before elision is attempted, so should not be a problem. However, the same check is now repeated twice in the path if elision is done, so might want to bypass that at some point. |
There's a hidden discussion here with some rationale
I think this was behaviour that was ruled as undesirable in that discussion. Evidently, it's too late for us to decide that. This needs a doc fix as well as @charris's patch |
See #9021. |
@pv Would it be appropriate to raise a |
I think what's deprecated is not so much this behavior, but the
__array_priority__ attribute itself.
|
For scipy.sparse the warning would make sense if scipy.sparse would plan
to deprecate the in-place behavior, but this will not be done so the
warning is just noise --- instead, the plan is to add replacement sparse
ndarray semantics compatible classes. I don't see a way to do any
gradual evolution of the old stuff, and it's better to just keep old
codes working.
|
For backward compatibility, we need to let `__array_priority__` determine the override for inplace ops. If `__array_ufunc__ = None` on the right hand side it is still the case that TypeError will be raised. This fixes SciPy test failures of the type ndarray += sparse_array Closes numpy#9019.
For backward compatibility, we need to let `__array_priority__` determine the override for inplace ops. If `__array_ufunc__ = None` on the right hand side it is still the case that TypeError will be raised. This fixes SciPy test failures of the type ndarray += sparse_array Closes numpy#9019.
The following works before merge of #8247.
After merge
The sparse matrices depend on the fact that they are cast to objects, so this is a function of how object arrays are handled,
The text was updated successfully, but these errors were encountered: