-
Notifications
You must be signed in to change notification settings - Fork 5
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 uarray support for scipy.linalg
#114
base: master
Are you sure you want to change the base?
Conversation
Smit-create
commented
Jan 10, 2022
- Reference issue: uarray based backend compatibility tracker scipy/scipy#14353
@rgommers
|
return a, b, q | ||
|
||
|
||
def _a_q_replacer(args, kwargs, dispatchables): |
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.
This and _a_b_replacer
further down seem identical, as does _A_E_replacer
. Why do we need multiple of these, just with a different name to match parameter names? It looks to me like this could be simplified.
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.
Why do we need multiple of these, just with a different name to match parameter names?
Yes, see scipy#14407 (comment)
That will reduce it a little; I suspect we may be able to get rid of some of those replacers completely to make it a small issue. The definitions could also be grouped together at the top of the file, right under Let's see what @AnirudhDagar and @czgdp1807 think as well. |
elif not coerce and not isinstance(value, np.ndarray): | ||
return NotImplemented | ||
|
||
return np.asarray(value) |
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.
As we discussed, this:
- overrides functions which use
asanyarray
internally, and - breaks for sparse matrix inputs
The asanyarray
should be looked into per function (and possibly removed, as I think is likely a good idea for clarkson_woodruff
), the sparse matrices need handling with an explicit check here and don't need to be coerced.
7b50add
to
815001e
Compare
69326d6
to
b2f933c
Compare
Yes. Putting together all the replacers might also help in discovering patterns which we can utilise in future. And yes, some replacers are exactly similar with just different function names. |
Linalg looks complete now and ready for higher-level review. Just some refactoring can make it look better. Also, we need to figure out the circular import issue in order to run the whole test suite with |