-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
BUG: linalg.norm(): Don't convert object arrays to float #7587
Conversation
This fixes numpy#7575 (Regression in linalg.norm() using dtype=object).
@@ -90,6 +90,12 @@ def test_svd_no_uv(self): | |||
assert_equal(np.linalg.matrix_rank(a), 1) | |||
assert_array_less(1, np.linalg.norm(a, ord=2)) | |||
|
|||
def test_norm_object_array(self): |
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.
It would be good to test more of the norms, or at least all that work with this fix.
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.
I've added more tests in bfa3ed9d29314d9d4a06eb5172ae855d19ae7c8d.
Everything that was broken before the regression is still broken.
I've added a comment to the issue #7575. |
I might put this in 1.11.1, but not 1.12, to give you more time to make your own version of norm and get that out there. Deal? |
If it's definitely going to be dropped for 1.12, I don't care about what's happening in 1.11.1. But I don't think this would be a good decision for the Let me offer a counter-deal: What about that? |
Let's put this in with the understanding that it is something of an implementation detail. If you want a guarantee that your work will not be affected by future changes you should pursue your own implementation of a norm function that works as you need it to for your application. |
Thanks @mgeier . |
This fixes #7575 (Regression in linalg.norm() using dtype=object).
Please tell me if I shall rebase this onto another branch.