-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
DEP: linalg: deprecate kron #21633
DEP: linalg: deprecate kron #21633
Conversation
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.
thanks! just one comment
Co-authored-by: Lucas Colley <lucas.colley8@gmail.com>
doctest failure is real |
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.
For the doctest failure, this seems to do the trick locally (a bit silly, though I suppose it makes the deprecation even harder to miss...). Maybe Evgeni has a slicker way to suppress the failure.
--- a/scipy/linalg/_special_matrices.py
+++ b/scipy/linalg/_special_matrices.py
@@ -337,9 +337,12 @@ def kron(a, b):
Examples
--------
+ >>> import warnings
>>> from numpy import array
>>> from scipy.linalg import kron
- >>> kron(array([[1,2],[3,4]]), array([[1,1,1]]))
+ >>> with warnings.catch_warnings():
+ ... warnings.simplefilter("ignore", DeprecationWarning)
+ ... kron(array([[1,2],[3,4]]), array([[1,1,1]]))
array([[1, 1, 1, 2, 2, 2],
[3, 3, 3, 4, 4, 4]])
There's a DeprecationWarning filter for doctests in https://github.com/scipy/scipy/blob/main/scipy/conftest.py#L382-L389, if you want to use that. |
thanks Jake! |
Reference issue
closes #20077
closes #20072
What does this implement/fix?
This was previously blocked by array-api discussions however now with data-apis/array-api-extra#7 I think we can now proceed.
Additional information